Struct prometheus::local::LocalHistogram
source · [−]pub struct LocalHistogram { /* private fields */ }
Expand description
An unsync Histogram
.
Implementations
sourceimpl LocalHistogram
impl LocalHistogram
sourcepub fn start_timer(&self) -> LocalHistogramTimer
pub fn start_timer(&self) -> LocalHistogramTimer
Return a LocalHistogramTimer
to track a duration.
sourcepub fn start_coarse_timer(&self) -> LocalHistogramTimer
pub fn start_coarse_timer(&self) -> LocalHistogramTimer
Return a LocalHistogramTimer
to track a duration.
It is faster but less precise.
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 observe_closure_duration_coarse<F, T>(&self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn observe_closure_duration_coarse<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
sourceimpl Clone for LocalHistogram
impl Clone for LocalHistogram
sourcefn clone(&self) -> LocalHistogram
fn clone(&self) -> LocalHistogram
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LocalHistogram
impl Debug for LocalHistogram
sourceimpl Drop for LocalHistogram
impl Drop for LocalHistogram
sourceimpl LocalMetric for LocalHistogram
impl LocalMetric for LocalHistogram
Auto Trait Implementations
impl !RefUnwindSafe for LocalHistogram
impl Send for LocalHistogram
impl !Sync for LocalHistogram
impl Unpin for LocalHistogram
impl UnwindSafe for LocalHistogram
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more