Bug 1442700 : Label added to TELEMETRY_SEND_FAILURE_TYPE and TelemetrySend's XHR_ERROR_TYPE for eTerminated , r?chutten draft
authorakriti <akriti.v10@gmail.com>
Wed, 28 Mar 2018 15:27:51 +0530
changeset 773691 13ac169cc983f082e9bb4f91d376c8a4fd4bc55e
parent 765972 8863806b9e28e9a5267c34c2e000f3cc0265f944
push id104277
push userbmo:akriti.v10@gmail.com
push dateWed, 28 Mar 2018 10:00:11 +0000
reviewerschutten
bugs1442700
milestone60.0a1
Bug 1442700 : Label added to TELEMETRY_SEND_FAILURE_TYPE and TelemetrySend's XHR_ERROR_TYPE for eTerminated , r?chutten MozReview-Commit-ID: 5JnGdYynRKF
dom/xhr/XMLHttpRequestMainThread.h
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/TelemetrySend.jsm
--- a/dom/xhr/XMLHttpRequestMainThread.h
+++ b/dom/xhr/XMLHttpRequestMainThread.h
@@ -180,16 +180,18 @@ public:
     error,
     abort,
     timeout,
     load,
     loadend,
     ENUM_MAX
   };
 
+  // Make sure that any additions done to ErrorType enum are also mirrored in
+  // XHR_ERROR_TYPE enum of TelemetrySend.jsm.
   enum class ErrorType : uint16_t {
     eOK,
     eRequest,
     eUnreachable,
     eChannelOpen,
     eRedirect,
     eTerminated,
     ENUM_MAX
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7239,17 +7239,18 @@
     "labels": [
       "eOK",
       "eRequest",
       "eUnreachable",
       "eChannelOpen",
       "eRedirect",
       "abort",
       "timeout",
-      "eTooLate"
+      "eTooLate",
+      "eTerminated"
     ],
     "description": "Counts of the different ways sending a Telemetry ping can fail."
   },
   "TELEMETRY_STRINGIFY" : {
     "record_in_processes": ["main"],
     "alert_emails": ["telemetry-client-dev@mozilla.com"],
     "expires_in_version": "never",
     "kind": "exponential",
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -84,22 +84,25 @@ const SEND_TICK_DELAY = 1 * MS_IN_A_MINU
 // This exponential backoff will be reset by external ping submissions & idle-daily.
 const SEND_MAXIMUM_BACKOFF_DELAY_MS = 120 * MS_IN_A_MINUTE;
 
 // The age of a pending ping to be considered overdue (in milliseconds).
 const OVERDUE_PING_FILE_AGE = 7 * 24 * 60 * MS_IN_A_MINUTE; // 1 week
 
 // Strings to map from XHR.errorCode to TELEMETRY_SEND_FAILURE_TYPE.
 // Echoes XMLHttpRequestMainThread's ErrorType enum.
+// Make sure that any additions done to XHR_ERROR_TYPE enum are also mirrored in
+// TELEMETRY_SEND_FAILURE_TYPE's labels.
 const XHR_ERROR_TYPE = [
   "eOK",
   "eRequest",
   "eUnreachable",
   "eChannelOpen",
   "eRedirect",
+  "eTerminated",
 ];
 
 /**
  * This is a policy object used to override behavior within this module.
  * Tests override properties on this object to allow for control of behavior
  * that would otherwise be very hard to cover.
  */
 var Policy = {