Bug 1365204 - Add update badge histogram r?rstrong draft
authorDoug Thayer <dothayer@mozilla.com>
Wed, 24 May 2017 09:32:01 -0700
changeset 583773 1dfd189a9ab87fbe9025af9795618e8fd625288c
parent 583750 e84acaf49a8f5032864a2602c1c61b68ceb1b773
child 630200 4bab4b74842e750f31ab4a1fb9cbc489c0f72235
push id60543
push userbmo:dothayer@mozilla.com
push dateWed, 24 May 2017 16:32:42 +0000
reviewersrstrong
bugs1365204
milestone55.0a1
Bug 1365204 - Add update badge histogram r?rstrong Currently we can't differentiate between when a badge is shown and a doorhanger is shown. This creates an additional problem where if the badge progresses into a doorhanger after a window of time has passed, it registers as two notifications shown, when logically it is one. This splits out badges and doorhangers to remedy that. MozReview-Commit-ID: CTTaWDG1tah
toolkit/components/telemetry/Histograms.json
toolkit/mozapps/update/UpdateListener.jsm
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -5824,16 +5824,26 @@
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "categorical",
     "bug_numbers": [893505],
     "releaseChannelCollection": "opt-out",
     "description": "Update: the application update doorhanger type that was displayed.",
     "labels": ["restart", "available", "manual"]
   },
+  "UPDATE_NOTIFICATION_BADGE_SHOWN": {
+    "record_in_processes": ["main"],
+    "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
+    "expires_in_version": "never",
+    "kind": "categorical",
+    "bug_numbers": [893505, 1365204],
+    "releaseChannelCollection": "opt-out",
+    "description": "Update: the application update badge type that was displayed.",
+    "labels": ["restart", "available", "manual"]
+  },
   "UPDATE_NOTIFICATION_DISMISSED": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["application-update-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "categorical",
     "bug_numbers": [893505],
     "releaseChannelCollection": "opt-out",
     "description": "Update: the dismiss action was executed for this application update doorhanger type.",
--- a/toolkit/mozapps/update/UpdateListener.jsm
+++ b/toolkit/mozapps/update/UpdateListener.jsm
@@ -96,17 +96,21 @@ var UpdateListener = {
       },
       dismiss: true
     };
 
     AppMenuNotifications.showNotification("update-" + type,
                                           action,
                                           secondaryAction,
                                           { dismissed, beforeShowDoorhanger });
-    Services.telemetry.getHistogramById("UPDATE_NOTIFICATION_SHOWN").add(type);
+    if (dismissed) {
+      Services.telemetry.getHistogramById("UPDATE_NOTIFICATION_BADGE_SHOWN").add(type);
+    } else {
+      Services.telemetry.getHistogramById("UPDATE_NOTIFICATION_SHOWN").add(type);
+    }
   },
 
   showRestartNotification(dismissed) {
     this.showUpdateNotification("restart", dismissed, () => this.requestRestart());
   },
 
   showUpdateAvailableNotification(update, dismissed) {
     this.showUpdateNotification("available", dismissed, () => {