[−][src]Struct metrics_util::Histogram
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]
pub fn new(bounds: &[u64]) -> Option<Histogram>
[src]
Creates a new Histogram
.
If bounds
is empty, returns None
.
pub fn sum(&self) -> u64
[src]
Gets the sum of all samples.
pub fn count(&self) -> u64
[src]
Gets the sample count.
pub fn buckets(&self) -> Vec<(u64, 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(&mut self, sample: u64)
[src]
Records a single sample.
pub fn record_many<'a, S>(&mut self, samples: S) where
S: IntoIterator<Item = &'a u64> + 'a,
[src]
S: IntoIterator<Item = &'a u64> + 'a,
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,