Struct prometheus::local::AFLocalHistogram
source · pub struct AFLocalHistogram<T: 'static + MayFlush, D: HistogramDelegator<T>> { /* private fields */ }
Expand description
Auto flush-able local counter
Implementations§
source§impl<T: 'static + MayFlush, D: HistogramDelegator<T>> AFLocalHistogram<T, D>
impl<T: 'static + MayFlush, D: HistogramDelegator<T>> AFLocalHistogram<T, D>
sourcepub fn new(delegator: D) -> AFLocalHistogram<T, D>
pub fn new(delegator: D) -> AFLocalHistogram<T, D>
Construct a new AFLocalHistogram from delegator
source§impl<M: 'static + MayFlush, D: HistogramDelegator<M>> AFLocalHistogram<M, D>
impl<M: 'static + MayFlush, D: HistogramDelegator<M>> AFLocalHistogram<M, D>
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.