Bug 1222054 - Route shutdown/saved-session pings through TelemetrySend. r=gfritzsche, a=ritu
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 10 Nov 2015 07:34:00 +0100
changeset 305636 1e0a87fb06a39ca01ae48f7e9e80ed622ea913c8
parent 305635 30cb3701070945e6701d504883fe2c674eb5196e
child 305637 6ad162acd38b9838ffb411eac2cc7efe1d9c4f1d
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, ritu
bugs1222054
milestone44.0a2
Bug 1222054 - Route shutdown/saved-session pings through TelemetrySend. r=gfritzsche, a=ritu
toolkit/components/telemetry/TelemetrySession.jsm
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -1570,47 +1570,48 @@ var Impl = {
     const isSubsession = !this._isClassicReason(reason);
     let payload = this.getSessionPayload(reason, isSubsession);
     payload.childUUID = this._processUUID;
     cpmm.sendAsyncMessage(MESSAGE_TELEMETRY_PAYLOAD, payload);
   },
 
    /**
     * Save both the "saved-session" and the "shutdown" pings to disk.
+    * This needs to be called after TelemetrySend shuts down otherwise pings
+    * would be sent instead of getting persisted to disk.
     */
   saveShutdownPings: function() {
     this._log.trace("saveShutdownPings");
 
     // We don't wait for "shutdown" pings to be written to disk before gathering the
     // "saved-session" payload. Instead we append the promises to this list and wait
     // on both to be saved after kicking off their collection.
     let p = [];
 
     if (IS_UNIFIED_TELEMETRY) {
       let shutdownPayload = this.getSessionPayload(REASON_SHUTDOWN, false);
 
       let options = {
         addClientId: true,
         addEnvironment: true,
-        overwrite: true,
       };
-      p.push(TelemetryController.addPendingPing(getPingType(shutdownPayload), shutdownPayload, options)
+      p.push(TelemetryController.submitExternalPing(getPingType(shutdownPayload), shutdownPayload, options)
                                 .catch(e => this._log.error("saveShutdownPings - failed to submit shutdown ping", e)));
      }
 
     // As a temporary measure, we want to submit saved-session too if extended Telemetry is enabled
     // to keep existing performance analysis working.
     if (Telemetry.canRecordExtended) {
       let payload = this.getSessionPayload(REASON_SAVED_SESSION, false);
 
       let options = {
         addClientId: true,
         addEnvironment: true,
       };
-      p.push(TelemetryController.addPendingPing(getPingType(payload), payload, options)
+      p.push(TelemetryController.submitExternalPing(getPingType(payload), payload, options)
                                 .catch (e => this._log.error("saveShutdownPings - failed to submit saved-session ping", e)));
     }
 
     // Wait on pings to be saved.
     return Promise.all(p);
   },