Bug 1389235 - Submit the bhr ping at least once a day, r=froydnj
authorMichael Layzell <michael@thelayzells.com>
Tue, 12 Sep 2017 15:27:04 -0400
changeset 430201 e4c134cc9847b8f4057fa30813362a4343ecd92c
parent 430200 81c5d6a866100e6c2d74b1ef584633fb5ba31295
child 430202 0d1afc4073ab81f7fb892018469cf594654ddda1
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1389235
milestone57.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 1389235 - Submit the bhr ping at least once a day, r=froydnj
toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
--- a/toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
+++ b/toolkit/components/backgroundhangmonitor/BHRTelemetryService.js
@@ -13,16 +13,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/TelemetryController.jsm");
 
 function BHRTelemetryService() {
   // Allow tests to get access to this object to verify it works correctly.
   this.wrappedJSObject = this;
 
   Services.obs.addObserver(this, "profile-before-change");
   Services.obs.addObserver(this, "bhr-thread-hang");
+  Services.obs.addObserver(this, "idle-daily");
 
   this.resetPayload();
 }
 
 BHRTelemetryService.prototype = Object.freeze({
   classID: Components.ID("{117c8cdf-69e6-4f31-a439-b8a654c67127}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
 
@@ -98,27 +99,31 @@ BHRTelemetryService.prototype = Object.f
       });
     }
     this.resetPayload();
   },
 
   shutdown() {
     Services.obs.removeObserver(this, "profile-before-change");
     Services.obs.removeObserver(this, "bhr-thread-hang");
+    Services.obs.removeObserver(this, "idle-daily");
     this.submit();
   },
 
   observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "profile-after-change":
       this.resetPayload();
       break;
     case "bhr-thread-hang":
       this.recordHang(aSubject.QueryInterface(Ci.nsIHangDetails));
       break;
     case "profile-before-change":
       this.shutdown();
       break;
+    case "idle-daily":
+      this.submit();
+      break;
     }
   },
 });
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BHRTelemetryService]);