Measurement of solid, liquid or gas content