tristanls/quantify — pull request #5 by tristanls (2014-11-20 04:44:13+00:00)
Title: 'size' to 'sampleSize'... and corrections

`size` is now `sampleSize` when metrics are reported.
Added runnable README example.
Corrected documentation.
Reported histogram now includes `count`.

Because I made the README example runnable, I changed it from making an HTTP call to `console.log` with a `**statsd**` "header" to demonstrate what can be done with the metrics.

Another thing of note was that I remembered the difference between `histogram.count` and `histogram.sampleSize`. The `histogram.count` is the total number of updates to the histogram. The `histogram.sampleSize` is the size of the sample from which histogram measures like percentiles are calculated. It is possible, even expected, for `histogram.sampleSize` to be less than `histogram.count` after the number of updates to the histogram exceeds the maximum sample capacity of the histogram. This is by design as the histogram allocates a finite amount of space for samples and after the number of samples exceeds this capacity, they are discarded using exponential decay.