pub struct Histogram { /* private fields */ }Expand description
A histogram samples observations and counts them in configurable buckets
Implementations§
Source§impl Histogram
impl Histogram
Sourcepub fn new(name: impl Into<String>, help: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, help: impl Into<String>) -> Self
Create a new histogram with default buckets
Sourcepub fn with_buckets(
name: impl Into<String>,
help: impl Into<String>,
config: BucketConfig,
) -> Self
pub fn with_buckets( name: impl Into<String>, help: impl Into<String>, config: BucketConfig, ) -> Self
Create a new histogram with custom buckets
Sourcepub fn bucket_counts(&self) -> Vec<u64>
pub fn bucket_counts(&self) -> Vec<u64>
Get bucket counts
Sourcepub fn boundaries(&self) -> &[f64]
pub fn boundaries(&self) -> &[f64]
Get bucket boundaries
Sourcepub fn percentile(&self, p: f64) -> Option<f64>
pub fn percentile(&self, p: f64) -> Option<f64>
Calculate percentile (approximate)
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 UnsafeUnpin 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