pub fn observe(&mut self, latency: Duration) {
        let ms = latency.as_millis() as i64;
        self.sum_millis += ms as usize;

        // The number of cells in the histogram is fixed, so this is really O(1).
        for (bucket, counter) in self.buckets.iter_mut().rev() {
            if *bucket < ms {
                break;
            }
            *counter += 1;
        }
    }
/// Updates this histogram with a new observed latency.
Updates this histogram with a new observed latency.
Updates this histogram with a new observed latency .
pub fn observe(&mut self, latency: Duration) {
        let ms = latency.as_millis() as i64;
        self.sum_millis += ms as usize;
        // The number of cells in the histogram is fixed, so this is really O(1).
        for (bucket, counter) in self.buckets.iter_mut().rev() {
            if *bucket < ms {
                break;
            }
            *counter += 1;
        }
    }
pub fn observe ( & mut self , latency : Duration ) { let ms = latency . as_millis ( ) as i64 ; self . sum_millis += ms as usize ; // The number of cells in the histogram is fixed, so this is really O(1). for ( bucket , counter ) in self . buckets . iter_mut ( ) . rev ( ) { if * bucket < ms { break ; } * counter += 1 ; } }
Updates this histogram with a new observed latency.
Updates this histogram with a new observed latency .
&mut self
latency
Duration
&mut self
latency
Duration