pub struct MultiHistogram {
name: String,
labels: Vec<String>,
hh: Histogram<f64>,
}Expand description
Represents a vector of histograms with floating point values.
Fields§
§name: String§labels: Vec<String>§hh: Histogram<f64>Implementations§
Source§impl MultiHistogram
impl MultiHistogram
Sourcepub fn new(
name: &str,
description: &str,
buckets: Vec<f64>,
labels: &[&str],
) -> MetricResult<Self>
pub fn new( name: &str, description: &str, buckets: Vec<f64>, labels: &[&str], ) -> MetricResult<Self>
Creates a new histogram with the given name, description, buckets and labels. 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]) -> MetricResult<SimpleTimer>
pub fn start_measure(&self, label_values: &[&str]) -> MetricResult<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 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.
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