pub struct SimpleHistogram { /* private fields */ }
Expand description
Represents a histogram with floating point values. Wrapper for Histogram type
Implementations§
Source§impl SimpleHistogram
impl SimpleHistogram
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.
Sourcepub fn get_sample_count(&self) -> u64
pub fn get_sample_count(&self) -> u64
Get all samples count
Sourcepub fn get_sample_sum(&self) -> f64
pub fn get_sample_sum(&self) -> f64
Get all samples sum
Source§impl SimpleHistogram
impl SimpleHistogram
Sourcepub fn new(name: &str, description: &str, buckets: Vec<f64>) -> Result<Self>
pub fn new(name: &str, description: &str, buckets: Vec<f64>) -> 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) -> SimpleTimer
pub fn start_measure(&self) -> SimpleTimer
Starts a timer.
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