Struct running_average::RunningAverage[][src]

pub struct RunningAverage<V: Default, I: TimeInstant + Copy> { /* fields omitted */ }

Represents running average calculation window. It is using specified window width that will consist of given number of accumulator buckets to ensure constant memory usage.

Methods

impl<V: Default, I: TimeInstant + Copy> RunningAverage<V, I>
[src]

Crate new RunningAverage instance that will average over window of width of given duration using 16 buckets.

Crate new RunningAverage instance that will average over window of width of given duration with specific number of buckets to use.

Insert value to be average over at given time instant. Panics if now is less than previous now - time cannot go backwards

Calculate running average using time window ending at given time instant. Panics if now is less than previous now - time cannot go backwards.

Trait Implementations

impl<V: Debug + Default, I: Debug + TimeInstant + Copy> Debug for RunningAverage<V, I>
[src]

Formats the value using the given formatter. Read more

impl<V: Default, I: TimeInstant + Copy> Default for RunningAverage<V, I>
[src]

Crate new RunningAverage instance with window of 8 seconds width and 16 buckets.

Auto Trait Implementations

impl<V, I> Send for RunningAverage<V, I> where
    I: Send,
    V: Send

impl<V, I> Sync for RunningAverage<V, I> where
    I: Sync,
    V: Sync