[−][src]Struct b2histogram::Base2Histogram
A compact and efficient integer histogram with fixed memory footprint, constant runtime performance, and very compact binary serialization.
Methods
impl Base2Histogram
[src]
pub fn new() -> Self
[src]
Create a new Base2Histogram
instance
pub fn record(&mut self, value: u64)
[src]
Record a single observation of value
pub fn record_n(&mut self, value: u64, count: u64)
[src]
Record count
observations of value
pub fn observations(&self, value: u64) -> u64
[src]
Returns the number of observations recorded by the bucket containing value
To retrieve the number of observations along with its bucket bounds, see
bucket_for()
.
pub fn bucket_for(&self, value: u64) -> Bucket
[src]
Return the Bucket
to which value
belongs.
To retrieve only the number of observations see
observations()
.
pub fn nonzero_buckets(&self) -> u32
[src]
Returns the number of buckets with one or more observations
pub fn has_counts(&self, value: u64) -> bool
[src]
Returns true
if the bucket count corresponding to value
is non-zero
pub fn iter(&self) -> impl Iterator<Item = Bucket> + '_
[src]
Iterate through all 64 buckets of the histogram in order (0..63)
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,