A stepped reflector on the outside of a bottomhole assembly produces two reflections in response to excitation of a transducer. The velocity of the fluid in the borehole is estimated using the two reflections. Alternatively, a change in the gas content of the borehole fluid is estimated from changes in the electrical impedance of a transducer in contact with the borehole fluid.