bug 1438335 - Document Histogram accumulation clamping behaviour r=Dexter
authorChris H-C <chutten@mozilla.com>
Thu, 15 Feb 2018 13:38:42 -0500
changeset 404658 a06841d0b44aa983377e0267075456483654b29f
parent 404657 01f045f12c5ced6f064ddc27524893dfd044dc11
child 404659 afef6b06366a4d360721def2d9b6ee1c1dc4988f
push id59929
push userchutten@mozilla.com
push dateWed, 21 Feb 2018 15:29:47 +0000
treeherderautoland@4aa002ab5d40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDexter
bugs1438335
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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");