Bug 1442700 : Label added to TELEMETRY_SEND_FAILURE_TYPE and TelemetrySend's XHR_ERROR_TYPE for eTerminated V2 , r?chutten
MozReview-Commit-ID: 32vRsduZBZ7
--- 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
@@ -7240,16 +7240,17 @@
"eOK",
"eRequest",
"eUnreachable",
"eChannelOpen",
"eRedirect",
"abort",
"timeout",
"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 = {