boundary/folsom — pull request #26 by russelldb (2012-06-01 19:46:23+00:00)
Title: Add a sliding window sample types for histograms

Uses ets to store a reservoir of readings for a sliding window sample.

Uses a gen_server to trim the size of the table every window / 2 seconds.

----

The time to calculate statistics is dependant on the number of samples. On a busy server a sliding window reservoir can end up with a lot of readings (20k ops/sec is 60*20k readings). This PR provides a hybrid sample type that keeps at most N readings per second in the sliding window, using a random uniform sample of the presented readings.