pub struct MultiHistogram { /* private fields */ }
Expand description
Represents a vector of histograms with floating point values. Wrapper for HistogramVec type
Implementations§
Source§impl MultiHistogram
impl MultiHistogram
Sourcepub fn record_measure(&self, timer: SimpleTimer)
pub fn record_measure(&self, timer: SimpleTimer)
Stops the given timer and records the elapsed duration in seconds to the multi-histogram.
Sourcepub fn cancel_measure(&self, timer: SimpleTimer) -> f64
pub fn cancel_measure(&self, timer: SimpleTimer) -> f64
Stops the given timer and discards the measured duration in seconds and returns it.
Source§impl MultiHistogram
impl MultiHistogram
Sourcepub fn new(
name: &str,
description: &str,
buckets: Vec<f64>,
labels: &[&str],
) -> Result<Self>
pub fn new( name: &str, description: &str, buckets: Vec<f64>, labels: &[&str], ) -> Result<Self>
Creates a new histogram with the given name, description and buckets. If no buckets are specified, they will be defined automatically. The +Inf bucket is always added automatically.
Sourcepub fn start_measure(&self, label_values: &[&str]) -> Result<SimpleTimer>
pub fn start_measure(&self, label_values: &[&str]) -> Result<SimpleTimer>
Starts a timer for a histogram with the given labels.
Sourcepub fn observe(&self, label_values: &[&str], value: f64)
pub fn observe(&self, label_values: &[&str], value: f64)
Records a value observation to the histogram with the given labels.
Sourcepub fn get_sample_count(&self, label_values: &[&str]) -> Option<u64>
pub fn get_sample_count(&self, label_values: &[&str]) -> Option<u64>
Get all samples count with given labels
Sourcepub fn get_sample_sum(&self, label_values: &[&str]) -> Option<f64>
pub fn get_sample_sum(&self, label_values: &[&str]) -> Option<f64>
Get all samples sum with given labels
Auto Trait Implementations§
impl Freeze for MultiHistogram
impl !RefUnwindSafe for MultiHistogram
impl Send for MultiHistogram
impl Sync for MultiHistogram
impl Unpin for MultiHistogram
impl !UnwindSafe for MultiHistogram
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more