Bug 764585 - make enumerated histograms harder to get wrong; r=taras
authorNathan Froyd <froydnj@mozilla.com>
Tue, 28 Aug 2012 13:21:56 -0400
changeset 103702 30c7ffa7bd97ca5709edeb0567ba9868714233dd
parent 103701 020c834a8991eb38904817fd64e3089f03d236a4
child 103703 e25785cfd8ad507dbd2dcced1031c3a1d187934d
push id14122
push usernfroyd@mozilla.com
push dateTue, 28 Aug 2012 20:15:30 +0000
treeherdermozilla-inbound@30c7ffa7bd97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstaras
bugs764585
milestone18.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 764585 - make enumerated histograms harder to get wrong; r=taras
toolkit/components/telemetry/gen-histogram-data.py
--- a/toolkit/components/telemetry/gen-histogram-data.py
+++ b/toolkit/components/telemetry/gen-histogram-data.py
@@ -55,16 +55,18 @@ def static_asserts_for_enumerated(histog
 def shared_static_asserts(histogram):
     name = histogram.name()
     low = histogram.low()
     high = histogram.high()
     n_buckets = histogram.n_buckets()
     static_assert("%s < %s" % (low, high), "low >= high for %s" % name)
     static_assert("%s > 2" % n_buckets, "Not enough values for %s" % name)
     static_assert("%s >= 1" % low, "Incorrect low value for %s" % name)
+    static_assert("%s > %s" % (high, n_buckets),
+                  "high must be > number of buckets for %s; you may want an enumerated histogram" % name)
 
 def static_asserts_for_linear(histogram):
     shared_static_asserts(histogram)
 
 def static_asserts_for_exponential(histogram):
     shared_static_asserts(histogram)
 
 def write_histogram_static_asserts(histograms):