pub struct Histogram { /* private fields */ }Expand description
Histogram stores the information needed to represent the sizes of the keys and values
as a histogram.
Histogram promises thread-safe.
Implementations
sourceimpl Histogram
impl Histogram
sourcepub fn new(bounds: Vec<f64>) -> Self
pub fn new(bounds: Vec<f64>) -> Self
Returns a new instance of HistogramData with properly initialized fields.
sourcepub fn update(&self, val: i64)
pub fn update(&self, val: i64)
Returns HistogramData base on the min exponent and max exponent. The bounds are powers of two of the form
[2^min_exponent, …, 2^max_exponent].
update changes the Min and Max fields if value is less than or greater than the current values.
sourcepub fn percentile(&self, p: f64) -> f64
pub fn percentile(&self, p: f64) -> f64
percentile returns the percentile value for the histogram.
value of p should be between [0.0-1.0]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Histogram
impl Send for Histogram
impl Sync for Histogram
impl Unpin for Histogram
impl !UnwindSafe for Histogram
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more