Work on caddis fly larvae illustrates the point. In the experiments, metabolic rates of caddis fly larvae increased when water current velocities decreased. These data suggest the larvae can somehow register changes in oxygen availability, then respond by ventilation. You can try it yourself. Hold your head underwater for some time, see if you don't register a change in oxygen availability.
Insects use a variety of methods to ventilate their gills.
Mayfly nymphs beat their abdominal gills in the absence of water movement. Larval dragonflies combine ventilation of gill surfaces with locomotion. Dragonfly larvae aspirate water into their rectums, which feature rectal gills. These larvae can locomote by jetting themselves forward. They do this by rapidly squirting aspirated water back out of their rectum.