pub struct Histogram { /* private fields */ }Expand description
Histogram for tracking value distributions (e.g., latency).
Implementations§
Source§impl Histogram
impl Histogram
Sourcepub fn new(bucket_bounds: Vec<f64>) -> Self
pub fn new(bucket_bounds: Vec<f64>) -> Self
Create a new histogram with predefined buckets. Buckets are defined as upper bounds.
Sourcepub fn for_latency_ms() -> Self
pub fn for_latency_ms() -> Self
Create a histogram with exponential buckets for latency (in milliseconds). Creates buckets: 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000ms
Sourcepub fn for_bandwidth_mbps() -> Self
pub fn for_bandwidth_mbps() -> Self
Create a histogram with exponential buckets for bandwidth (in Mbps).
Sourcepub fn percentile(&self, p: f64) -> f64
pub fn percentile(&self, p: f64) -> f64
Estimate a percentile from the histogram.
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