Bug 932285 - part 1 - iterate over registered histograms, then check existence in snapshots; r=vladan
authorNathan Froyd <froydnj@mozilla.com>
Fri, 13 Dec 2013 12:22:02 -0500
changeset 160484 f0579da7f7f4b03b857b0549e80704304d315078
parent 160483 653645bf66fb3cf087354a265a1d7d2830f384f2
child 160485 2050afa859b4f6fd3548b427167139ee6f6480e8
push id25834
push userphilringnalda@gmail.com
push dateSun, 15 Dec 2013 02:20:53 +0000
treeherdermozilla-central@9fcc6330dc69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladan
bugs932285
milestone29.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 932285 - part 1 - iterate over registered histograms, then check existence in snapshots; r=vladan
toolkit/components/telemetry/TelemetryPing.js
--- a/toolkit/components/telemetry/TelemetryPing.js
+++ b/toolkit/components/telemetry/TelemetryPing.js
@@ -1,9 +1,9 @@
-/* -*- indent-tabs-mode: nil -*- */
+/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
@@ -280,25 +280,24 @@ TelemetryPing.prototype = {
 
     // add an upper bound
     if (last && last < c.length)
       retgram.values[r[last]] = 0;
     return retgram;
   },
 
   getHistograms: function getHistograms(hls) {
-    let info = Telemetry.registeredHistograms;
+    let registered = Telemetry.registeredHistograms;
     let ret = {};
 
-    for (let name in hls) {
-      if (info[name]) {
-        ret[name] = this.packHistogram(hls[name]);
-        let startup_name = "STARTUP_" + name;
-        if (hls[startup_name])
-          ret[startup_name] = this.packHistogram(hls[startup_name]);
+    for (let name in registered) {
+      for (let n of [name, "STARTUP_" + name]) {
+        if (n in hls) {
+          ret[n] = this.packHistogram(hls[n]);
+        }
       }
     }
 
     return ret;
   },
 
   getAddonHistograms: function getAddonHistograms() {
     let ahs = Telemetry.addonHistogramSnapshots;