Bug 1000719 - Add tracing on logging experiment rejections and telemetry tests. r=bsmedberg
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Mon, 28 Apr 2014 16:11:26 +0200
changeset 181039 d25120c7a148b85f477595fcde0af21e9321c11c
parent 181038 cf36a41c16483c38081c47805f932b384496fe13
child 181040 bef43b38d6ae2baa0f18c9da53f27b9b9a6ed0b3
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersbsmedberg
bugs1000719
milestone31.0a1
Bug 1000719 - Add tracing on logging experiment rejections and telemetry tests. r=bsmedberg
browser/experiments/Experiments.jsm
browser/experiments/test/xpcshell/test_telemetry.js
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -1118,17 +1118,19 @@ Experiments.Experiments.prototype = {
           reason = e;
         }
 
         if (!applicable && reason && reason[0] != "was-active") {
           // Report this from here to avoid over-reporting.
           let desc = TELEMETRY_LOG.ACTIVATION;
           let data = [TELEMETRY_LOG.ACTIVATION.REJECTED, id];
           data = data.concat(reason);
-          TelemetryLog.log(TELEMETRY_LOG.ACTIVATION_KEY, data);
+          const key = TELEMETRY_LOG.ACTIVATION_KEY;
+          TelemetryLog.log(key, data);
+          this._log.trace("evaluateExperiments() - added " + key + " to TelemetryLog: " + JSON.stringify(data));
         }
 
         if (!applicable) {
           continue;
         }
 
         this._log.debug("evaluateExperiments() - activating experiment " + id);
         try {
--- a/browser/experiments/test/xpcshell/test_telemetry.js
+++ b/browser/experiments/test/xpcshell/test_telemetry.js
@@ -170,16 +170,17 @@ add_task(function* test_telemetryBasics(
   defineNow(gPolicy, now);
 
   yield experiments.updateManifest();
   let list = yield experiments.getExperiments();
   Assert.equal(list.length, 0, "Experiment list should be empty.");
 
   expectedLogLength += 2;
   let log = TelemetryPing.getPayload().log;
+  do_print("Telemetry log: " + JSON.stringify(log));
   Assert.equal(log.length, expectedLogLength, "Telemetry log should have " + expectedLogLength + " entries.");
   checkEvent(log[log.length-2], TLOG.ACTIVATION_KEY,
              [TLOG.ACTIVATION.REJECTED, EXPERIMENT1_ID, "startTime"]);
   checkEvent(log[log.length-1], TLOG.ACTIVATION_KEY,
              [TLOG.ACTIVATION.REJECTED, EXPERIMENT2_ID, "startTime"]);
 
   // Trigger update, clock set for experiment 1 to start.