[][src]Struct prometheus::HistogramTimer

#[must_use = "Timer should be kept in a variable otherwise it cannot observe duration"]
pub struct HistogramTimer { /* fields omitted */ }

A struct represents an event being timed. When the timer goes out of scope, the duration will be observed, or call observe_duration to manually observe.

NOTICE: A timer can be observed only once (automatically or manually).

Methods

impl HistogramTimer[src]

pub fn observe_duration(self)[src]

observe_duration observes the amount of time in seconds since Histogram.start_timer was called.

Trait Implementations

impl Drop for HistogramTimer[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]