bug 1460595 - Add meta-telemetry to record how many event pings we're sending r?Dexter draft
authorChris H-C <chutten@mozilla.com>
Mon, 14 May 2018 10:43:18 -0400
changeset 810757 034e5729578e
parent 810756 6070400f23ac
child 810758 4d903b78b6bb
push id114089
push userbmo:chutten@mozilla.com
push dateTue, 26 Jun 2018 12:37:14 +0000
reviewersDexter
bugs1460595
milestone63.0a1
bug 1460595 - Add meta-telemetry to record how many event pings we're sending r?Dexter MozReview-Commit-ID: 7kxmvItSzEU
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/TelemetryEventPing.jsm
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7187,16 +7187,29 @@
   "TELEMETRY_SCHEDULER_WAKEUP": {
     "record_in_processes": ["main"],
     "alert_emails": ["telemetry-client-dev@mozilla.com"],
     "bug_numbers": [1250640],
     "expires_in_version": "53",
     "kind": "count",
     "description": "Count of TelemetrySession scheduler ticks that were delayed long enough to suspect sleep."
   },
+  "TELEMETRY_EVENT_PING_SENT": {
+    "record_in_processes": ["main"],
+    "alert_emails": ["telemetry-client-dev@mozilla.com", "chutten@mozilla.com"],
+    "bug_numbers": [1460595],
+    "expires_in_version": "never",
+    "kind": "categorical",
+    "labels": [
+      "periodic",
+      "max",
+      "shutdown"
+    ],
+    "description": "Number of 'event' pings sent, by reason"
+  },
   "TELEMETRY_TEST_FLAG": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["telemetry-client-dev@mozilla.com"],
     "expires_in_version": "never",
     "kind": "flag",
     "description": "a testing histogram; not meant to be touched"
   },
   "TELEMETRY_TEST_COUNT": {
--- a/toolkit/components/telemetry/TelemetryEventPing.jsm
+++ b/toolkit/components/telemetry/TelemetryEventPing.jsm
@@ -189,16 +189,17 @@ var TelemetryEventPing = {
 
     const options = {
       addClientId: true,
       addEnvironment: true,
       usePingSender: reason == this.Reason.SHUTDOWN,
     };
 
     this._lastSendTime = Utils.monotonicNow();
+    Telemetry.getHistogramById("TELEMETRY_EVENT_PING_SENT").add(reason);
     Policy.sendPing(this.EVENT_PING_TYPE, payload, options);
   },
 
   /**
    * Test-only, restore to initial state.
    */
   testReset() {
     this._lastSendTime = -DEFAULT_MIN_FREQUENCY_MS;