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>
Sun, 25 Mar 2018 16:48:12 +0530
changeset 772212 b4a56e8af0094f6897ba1d6e60384c618a514f89
parent 765972 8863806b9e28e9a5267c34c2e000f3cc0265f944
push id103873
push userbmo:akriti.v10@gmail.com
push dateSun, 25 Mar 2018 11:20:14 +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: 50UaVrebTcm
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
@@ -7236,16 +7236,17 @@
     "bug_numbers": [1367110],
     "expires_in_version": "66",
     "kind": "categorical",
     "labels": [
       "eOK",
       "eRequest",
       "eUnreachable",
       "eChannelOpen",
+      "eTerminated",
       "eRedirect",
       "abort",
       "timeout",
       "eTooLate"
     ],
     "description": "Counts of the different ways sending a Telemetry ping can fail."
   },
   "TELEMETRY_STRINGIFY" : {
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -84,21 +84,24 @@ 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",
+  "eTerminated",
   "eRedirect",
 ];
 
 /**
  * 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.
  */