pub struct HDRHist { /* private fields */ }
Expand description
An hdr histogram that collects u64
sample with 5 bit precision.
Implementations§
Source§impl HDRHist
impl HDRHist
Sourcepub fn add_value(&mut self, value: u64)
pub fn add_value(&mut self, value: u64)
Add a sample to the histogram.
This is guaranteed to be constant time and never re-allocates.
Sourcepub fn combined(self, other: Self) -> Self
pub fn combined(self, other: Self) -> Self
Combine this histogram with another. This doesn’t normalize, and only adds the per-bucket counts. Only use it for histograms that have captured a comparable number of samples.
Sourcepub fn ccdf<'a>(&'a self) -> impl Iterator<Item = (u64, f64, u64)> + 'a
pub fn ccdf<'a>(&'a self) -> impl Iterator<Item = (u64, f64, u64)> + 'a
Output the complementary cumulative distribution function (ccdf) of the samples
Returns an iterator over increasing sample values such that, for every triple
(value, prob, count)
, prob
is the ratio of samples >= value
, and
count
is the number of samples >= the current value
and < the next value
.
Sourcepub fn ccdf_upper_bound<'a>(&'a self) -> impl Iterator<Item = (u64, f64)> + 'a
pub fn ccdf_upper_bound<'a>(&'a self) -> impl Iterator<Item = (u64, f64)> + 'a
Outputs an upper bound of the complementary cumulative distribution function (ccdf) of the samples.
You can use these points to plot with linear interpolation and never report intermediate sample values that underestimate quantiles. In other words, all the actual quantile values will be below the reported curve.
Sourcepub fn ccdf_lower_bound<'a>(&'a self) -> impl Iterator<Item = (u64, f64)> + 'a
pub fn ccdf_lower_bound<'a>(&'a self) -> impl Iterator<Item = (u64, f64)> + 'a
Outputs an upper bound of the complementary cumulative distribution function (ccdf) of the samples.
You can use these points to plot with linear interpolation and never report intermediate sample values that overestimate quantiles. In other words, all the actual quantile values will be above the reported curve.
Sourcepub fn quantiles<'a>(
&'a self,
quantiles: impl Iterator<Item = f64> + 'a,
) -> impl Iterator<Item = (f64, u64, u64)> + 'a
pub fn quantiles<'a>( &'a self, quantiles: impl Iterator<Item = f64> + 'a, ) -> impl Iterator<Item = (f64, u64, u64)> + 'a
Output estimated quantiles as (quantile, lower_bound, upper_bound) pairs
Each quantile’s value is somewhere >= lower_bound and < upper_bound
Sourcepub fn summary<'a>(&'a self) -> impl Iterator<Item = (f64, u64, u64)> + 'a
pub fn summary<'a>(&'a self) -> impl Iterator<Item = (f64, u64, u64)> + 'a
Output a summary of estimated quantiles
Sourcepub fn summary_string(&self) -> String
pub fn summary_string(&self) -> String
Output a text summary of estimated quantiles
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HDRHist
impl RefUnwindSafe for HDRHist
impl Send for HDRHist
impl Sync for HDRHist
impl Unpin for HDRHist
impl UnwindSafe for HDRHist
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)