pub struct Timer { /* private fields */ }
Expand description

A metric tracking the duration and rate of events.

The timer’s default reservoir implementation (used by its Default implementation) is the ExponentiallyDecayingReservoir.

Implementations

Creates a new timer.

Creates a new timer using the provided Clock as its time source.

Adds a new timed event to the metric.

Returns a guard type which reports the time elapsed since its creation when it drops.

Returns the number of events reported to the metric.

Returns the one minute rolling average rate of the occurrence of events measured in events per second.

Returns the five minute rolling average rate of the occurrence of events measured in events per second.

Returns the fifteen minute rolling average rate of the occurrence of events measured in events per second.

Returns the mean rate of the occurrence of events since the creation of the timer measured in events per second.

Returns a snapshot of the statistical distribution of durations of events, measured in nanoseconds.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.