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§
source§impl ExponentialDecayHistogram
impl ExponentialDecayHistogram
sourcepub fn new() -> ExponentialDecayHistogram
pub fn new() -> ExponentialDecayHistogram
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.
sourcepub fn with_size_and_alpha(size: usize, alpha: f64) -> ExponentialDecayHistogram
pub fn with_size_and_alpha(size: usize, alpha: f64) -> ExponentialDecayHistogram
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.
Trait Implementations§
source§impl Default for ExponentialDecayHistogram
impl Default for ExponentialDecayHistogram
source§fn default() -> ExponentialDecayHistogram
fn default() -> ExponentialDecayHistogram
Returns the “default value” for a type. Read more