pub struct Histogram { /* private fields */ }Expand description
Histogram with exponential bucket boundaries.
Bucket boundaries are in seconds. Default: [0.001, 0.01, 0.1, 1, 10].
Implementations§
Source§impl Histogram
impl Histogram
Sourcepub fn new(name: impl Into<String>, buckets: &[f64]) -> Self
pub fn new(name: impl Into<String>, buckets: &[f64]) -> Self
Build a histogram with finite bucket boundaries, sorted ascending and
deduplicated. Non-finite values are ignored; the implicit +Inf bucket
is always appended by Self::bucket_counts.
pub fn observe(&self, d: Duration)
pub fn count(&self) -> u64
pub fn sum_seconds(&self) -> f64
pub fn bucket_counts(&self) -> Vec<(f64, u64)>
pub fn name(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Histogram
impl RefUnwindSafe for Histogram
impl Send for Histogram
impl Sync for Histogram
impl Unpin for Histogram
impl UnwindSafe for Histogram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more