Struct prometheus::local::AFLocalHistogram
source · [−]pub struct AFLocalHistogram<T: 'static + MayFlush, D: HistogramDelegator<T>> { /* private fields */ }
Expand description
Auto flush-able local counter
Implementations
sourceimpl<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
sourceimpl<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) -> T where
F: FnOnce() -> T,
pub fn observe_closure_duration<F, T>(&self, f: F) -> T where
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
Auto Trait Implementations
impl<T, D> !RefUnwindSafe for AFLocalHistogram<T, D>
impl<T, D> Send for AFLocalHistogram<T, D> where
D: Send,
T: Send,
impl<T, D> Sync for AFLocalHistogram<T, D> where
D: Sync,
T: Send,
impl<T, D> Unpin for AFLocalHistogram<T, D> where
D: Unpin,
T: Unpin,
impl<T, D> UnwindSafe for AFLocalHistogram<T, D> where
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more