[][src]Struct exponential_decay_histogram::Builder

pub struct Builder { /* fields omitted */ }

A builder type for ExponentialDecayHistogram objects.

Implementations

impl Builder[src]

pub fn at(&mut self, now: Instant) -> &mut Self[src]

Sets the construction time of the histogram.

Defaults to the system time when the Builder was constructed.

pub fn size(&mut self, size: usize) -> &mut Self[src]

Sets the size of the histogram.

A larger size will provide a more accurate histogram, but with a higher memory overhead.

Defaults to 1028, which offers a 99.9% confidence level with a 5% margin of error.

Panics

Panics if size is 0.

pub fn alpha(&mut self, alpha: f64) -> &mut Self[src]

Sets the decay rate of the histogram.

A larger value biases the histogram towards newer values.

Defaults to 0.015, which heavily biases towards the last 5 minutes of values.

pub fn build(&self) -> ExponentialDecayHistogram[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,