Bug 1186492 - Add a probe to track client-side ping eviction due to server errors. r=gfritzsche
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Thu, 30 Jul 2015 06:48:00 +0200
changeset 287272 54d3c013705662f49286a3caf5f2b370c9767940
parent 287271 f43ef293278b40468216335575a8b230f55102be
child 287273 5ad2d34c58b16975117d385c324e6e40df83828f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1186492
milestone42.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 1186492 - Add a probe to track client-side ping eviction due to server errors. r=gfritzsche
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/TelemetrySend.jsm
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4752,16 +4752,22 @@
   },
   "TELEMETRY_INVALID_PING_TYPE_SUBMITTED": {
     "alert_emails": ["telemetry-client-dev@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "keyed": true,
     "description": "Count of individual invalid ping types that were submitted to Telemetry."
   },
+  "TELEMETRY_PING_EVICTED_FOR_SERVER_ERRORS": {
+    "alert_emails": ["telemetry-client-dev@mozilla.com"],
+    "expires_in_version": "never",
+    "kind": "count",
+    "description": "Number of Telemetry ping files evicted due to server errors (4XX HTTP code received)"
+  },
   "TELEMETRY_TEST_FLAG": {
     "expires_in_version": "never",
     "kind": "flag",
     "description": "a testing histogram; not meant to be touched"
   },
   "TELEMETRY_TEST_COUNT": {
     "expires_in_version": "never",
     "kind": "count",
--- a/toolkit/components/telemetry/TelemetrySend.jsm
+++ b/toolkit/components/telemetry/TelemetrySend.jsm
@@ -896,16 +896,17 @@ let TelemetrySendImpl = {
       if (statusClass === 200) {
         // We can treat all 2XX as success.
         this._log.info("_doPing - successfully loaded, status: " + status);
         success = true;
       } else if (statusClass === 400) {
         // 4XX means that something with the request was broken.
         this._log.error("_doPing - error submitting to " + url + ", status: " + status
                         + " - ping request broken?");
+        Telemetry.getHistogramById("TELEMETRY_PING_EVICTED_FOR_SERVER_ERRORS").add();
         // TODO: we should handle this better, but for now we should avoid resubmitting
         // broken requests by pretending success.
         success = true;
       } else if (statusClass === 500) {
         // 5XX means there was a server-side error and we should try again later.
         this._log.error("_doPing - error submitting to " + url + ", status: " + status
                         + " - server error, should retry later");
       } else {