Struct metrics_util::Histogram [−][src]
pub struct Histogram { /* fields omitted */ }
Expand description
A bucketed histogram.
This histogram tracks the number of samples that fall into pre-defined buckets, rather than exposing any sort of quantiles.
This type is most useful with systems that prefer bucketed data, such as Prometheus’ histogram type, as opposed to its summary type, which deals with quantiles.
Implementations
impl Histogram
[src]
impl Histogram
[src]pub fn new(bounds: &[f64]) -> Option<Histogram>
[src]
pub fn new(bounds: &[f64]) -> Option<Histogram>
[src]Creates a new Histogram
.
If bounds
is empty, returns None
.
pub fn buckets(&self) -> Vec<(f64, u64)>
[src]
pub fn buckets(&self) -> Vec<(f64, u64)>
[src]Gets the buckets.
Buckets are tuples, where the first element is the bucket limit itself, and the second element is the count of samples in that bucket.
pub fn record_many<'a, S>(&mut self, samples: S) where
S: IntoIterator<Item = &'a f64> + 'a,
[src]
pub fn record_many<'a, S>(&mut self, samples: S) where
S: IntoIterator<Item = &'a f64> + 'a,
[src]Records multiple samples.
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
[src]
impl<T> Pointable for T
[src]impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more