Adaptive packet sampling for flow volume measurement