[][src]Struct b2histogram::Base2Histogram

pub struct Base2Histogram { /* fields omitted */ }

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> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]