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.
Trait Implementations§
Auto Trait Implementations§
impl<T, D> Freeze for AFLocalHistogram<T, D>where
D: Freeze,
impl<T, D> !RefUnwindSafe for AFLocalHistogram<T, D>
impl<T, D> Send for AFLocalHistogram<T, D>
impl<T, D> Sync for AFLocalHistogram<T, D>
impl<T, D> Unpin for AFLocalHistogram<T, D>
impl<T, D> UnwindSafe for AFLocalHistogram<T, D>where
D: UnwindSafe,
T: UnwindSafe,
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