pub struct AFLocalHistogram<T, D>where
T: 'static + MayFlush,
D: HistogramDelegator<T>,{ /* private fields */ }
Expand description
Auto flush-able local counter
Implementations§
Source§impl<T, D> AFLocalHistogram<T, D>where
T: 'static + MayFlush,
D: HistogramDelegator<T>,
impl<T, D> AFLocalHistogram<T, D>where
T: 'static + MayFlush,
D: HistogramDelegator<T>,
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, D> AFLocalHistogram<M, D>where
M: 'static + MayFlush,
D: HistogramDelegator<M>,
impl<M, D> AFLocalHistogram<M, D>where
M: 'static + MayFlush,
D: HistogramDelegator<M>,
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