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
--- 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, () => {