Bases: object
Moving average class implementation
Constructor.
period
Moving window size. Average will be calculated
from the data in the window.
add(n)
Add value to the current accumulator
n
Value to add
flush()
Add accumulator to the moving average queue
and reset it. For example, called by the StatsCollector
once per second to calculate per-second average.