[][src]Module jupiter::average

Provides a helper which computes a average of a series of values.

This is intended to be used when measuring the system performance which is often tracked as averages (e.g. execution duration of commands.

An Average is internally mutable without needing a mutable reference as we rely on atomic intrinsics as provided by modern processors / compilers.

Example

let avg = Average::new();
avg.add(10);
avg.add(20);
avg.add(30);

assert_eq!(avg.avg(), 20);
assert_eq!(avg.count(), 3);

Structs

Average

Computes a sliding average of a series of values.