Struct prometheus::HistogramTimer [−][src]
Timer to measure and record the duration of an event.
This timer can be stopped and observed at most once, either automatically (when it goes out of scope) or manually. Alternatively, it can be manually stopped and discarded in order to not record its value.
Implementations
impl HistogramTimer
[src]
pub fn observe_duration(self)
[src]
Observe and record timer duration (in seconds).
It observes the floating-point number of seconds elapsed since the timer started, and it records that value to the attached histogram.
pub fn stop_and_record(self) -> f64
[src]
Observe, record and return timer duration (in seconds).
It observes and returns a floating-point number for seconds elapsed since the timer started, recording that value to the attached histogram.
pub fn stop_and_discard(self) -> f64
[src]
Observe and return timer duration (in seconds).
It returns a floating-point number of seconds elapsed since the timer started, without recording to any histogram.
Trait Implementations
impl Debug for HistogramTimer
[src]
impl Drop for HistogramTimer
[src]
Auto Trait Implementations
impl RefUnwindSafe for HistogramTimer
impl Send for HistogramTimer
impl Sync for HistogramTimer
impl Unpin for HistogramTimer
impl UnwindSafe for HistogramTimer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,