bug 1438335 - Document Histogram accumulation clamping behaviour r?Dexter draft
authorChris H-C <chutten@mozilla.com>
Thu, 15 Feb 2018 13:38:42 -0500
changeset 757284 a6ef7737c24e523c328ccbdd5d96e028f08ba48a
parent 757283 697e02fd8011cb553701a7e7f9f8f1fb3fcf9fec
child 757285 e45b7b6776e6a76b1fcf0a106e4f117e6fd547d6
push id99742
push userbmo:chutten@mozilla.com
push dateTue, 20 Feb 2018 17:04:55 +0000
reviewersDexter
bugs1438335
milestone60.0a1
bug 1438335 - Document Histogram accumulation clamping behaviour r?Dexter MozReview-Commit-ID: K7gB4zoAleM
toolkit/components/telemetry/docs/collection/histograms.rst
--- a/toolkit/components/telemetry/docs/collection/histograms.rst
+++ b/toolkit/components/telemetry/docs/collection/histograms.rst
@@ -204,16 +204,25 @@ Changing a histogram
 ====================
 Changing histogram declarations after the histogram has been released is tricky. Many tools (like `the aggregator <https://github.com/mozilla/python_mozaggregator>`_) assume histograms don't change. The current recommended procedure is to change the name of the histogram.
 
 * When changing existing histograms, the recommended pattern is to use a versioned name (``PROBE``, ``PROBE_2``, ``PROBE_3``, ...).
 * For enum histograms, it's recommended to set "n_buckets" to a slightly larger value than needed since new elements may be added to the enum in the future.
 
 The one exception is categorical histograms which can only be changed by adding labels, and only until it reaches 50 labels.
 
+Histogram values
+================
+
+The values you can accumulate to Histograms are limited by their internal represenation.
+
+Telemetry Histograms do not record negative values, instead clamping them to 0 before recording.
+
+Telemetry Histograms do not record values greater than 2^31, instead clamping them to INT_MAX before recording.
+
 Adding a JavaScript Probe
 =========================
 
 A Telemetry probe is the code that measures and stores values in a histogram. Probes in privileged JavaScript code can make use of the `nsITelemetry <https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/nsITelemetry.idl>`_ interface to get references to histogram objects. A new value is recorded in the histogram by calling ``add`` on the histogram object:
 
 .. code-block:: js
 
   let histogram = Services.telemetry.getHistogramById("PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS");