stumbleupon/opentsdb — pull request #93 by deusaquilus (2012-01-23 02:59:18+00:00)
Title: Standard Deviation Aggregator

Hi Benoit it's Alex Ioffe.
Here's the memory-merciful Standard Deviation Aggregator I previously sent you (based on the paper by John Cook here: http://www.johndcook.com/standard_deviation.html). I put the code inside of Aggregators.java together with everything else. The test TestStandardDeviationAggregator.java makes sure it works properly. The best way to use Standard Deviation is as a Downsampling Aggregator, in the rest API it would look like this:

/q?start=30s-ago&m=sum:30s-std:my.metric&ascii

Please add the this query to the OpenTSDB documentation (to http://opentsdb.net/http-api.html or some similar place otherwise people might get confused). If you use it just as m=std:my.metric&ascii it will probably return 0 since there won't be enough samples per second to calculate it (std returns 0 when there are 1 or fewer samples but feel free to change this behavior).

Enjoy,
-Alex Ioffe