pub struct SimpleHistogram {
name: String,
hh: Histogram<f64>,
}Expand description
Represents a histogram with floating point values.
Fields§
§name: String§hh: Histogram<f64>Implementations§
Source§impl SimpleHistogram
impl SimpleHistogram
Sourcepub fn new(
name: &str,
description: &str,
buckets: Vec<f64>,
) -> MetricResult<Self>
pub fn new( name: &str, description: &str, buckets: Vec<f64>, ) -> MetricResult<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) -> SimpleTimer
pub fn start_measure(&self) -> SimpleTimer
Starts a timer.
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 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 SimpleHistogram
impl !RefUnwindSafe for SimpleHistogram
impl Send for SimpleHistogram
impl Sync for SimpleHistogram
impl Unpin for SimpleHistogram
impl !UnwindSafe for SimpleHistogram
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