Struct exponential_decay_histogram::ExponentialDecayHistogram [] [src]

pub struct ExponentialDecayHistogram { /* fields omitted */ }

A histogram which exponentially weights in favor of recent values.

See the crate level documentation for more details.

Methods

impl ExponentialDecayHistogram
[src]

[src]

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.

[src]

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.

[src]

Inserts a value into the histogram at the current time.

[src]

Inserts a value into the histogram at the specified time.

Panics

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

[src]

Takes a snapshot of the current state of the histogram.

Trait Implementations

impl Default for ExponentialDecayHistogram
[src]

[src]

Returns the "default value" for a type. Read more