sockjs.tornado.stats

class sockjs.tornado.stats.StatsCollector(io_loop)[source]
dump()[source]

Return dictionary with current statistical information

class sockjs.tornado.stats.MovingAverage(period=10)[source]

Moving average class implementation

__init__(period=10)[source]

Constructor.

period
Moving window size. Average will be calculated from the data in the window.
add(n)[source]

Add value to the current accumulator

n
Value to add
flush()[source]

Add accumulator to the moving average queue and reset it. For example, called by the StatsCollector once per second to calculate per-second average.