Struct prometheus::local::LocalHistogram
source · pub struct LocalHistogram { /* private fields */ }
Expand description
An unsync Histogram
.
Implementations§
source§impl LocalHistogram
impl LocalHistogram
sourcepub fn start_timer(&self) -> LocalHistogramTimer
pub fn start_timer(&self) -> LocalHistogramTimer
Return a LocalHistogramTimer
to track a duration.
sourcepub fn observe_closure_duration<F, T>(&self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn observe_closure_duration<F, T>(&self, f: F) -> Twhere
F: FnOnce() -> T,
Observe execution time of a closure, in second.
sourcepub fn get_sample_sum(&self) -> f64
pub fn get_sample_sum(&self) -> f64
Return accumulated sum of local samples.
sourcepub fn get_sample_count(&self) -> u64
pub fn get_sample_count(&self) -> u64
Return count of local samples.
Trait Implementations§
source§impl Clone for LocalHistogram
impl Clone for LocalHistogram
source§fn clone(&self) -> LocalHistogram
fn clone(&self) -> LocalHistogram
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more