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

A histogram which exponentially weights in favor of recent values.

See the crate level documentation for more details.

Implementations§

Returns a new histogram with a default configuration.

The default size is 1028, which offers a 99.9% confidence level with a 5% margin of error. The default alpha is 0.015, which heavily biases towards the last 5 minutes of values.

Returns a new histogram configured with the specified size and alpha.

size specifies the number of values stored in the histogram. A larger size will provide more accurate statistics, but with a higher memory overhead.

alpha specifies the exponential decay factor. A larger factor biases the histogram towards newer values.

Panics

Panics if size is zero.

Inserts a value into the histogram at the current time.

Inserts a value into the histogram at the specified time.

Panics

May panic if values are inserted at non-monotonically increasing times.

Takes a snapshot of the current state of the histogram.

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.