cyberdelia / metrology

A library to easily measure what's going on in your python.
https://metrology.readthedocs.org
MIT License
309 stars 25 forks source link

Meter.one_minute_rate is wrong and/or badly documented #36

Open cbouilla opened 6 years ago

cbouilla commented 6 years ago

The following code:

rate = Meter()
for i in range(int(65/0.05)):
     rate.mark()
     time.sleep(0.05)
print(rate.one_minute_rate)
print(rate.mean_rate)

yields:

12.744700289590714
19.916839105797937

Why does the one-minute moving average differs from the average over the first minute?