From dcd122aa510d5aa095bc21c7caf4c8939234752f Mon Sep 17 00:00:00 2001 From: Doug Thayer Date: Wed, 24 May 2017 09:32:01 -0700 Subject: [PATCH] Bug 1365204 - Add update badge histogram r=bsmedberg,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 --HG-- extra : rebase_source : 2b13b703ac4e12caa040138dadd2875df76ff61a --- toolkit/components/telemetry/Histograms.json | 10 ++++++++++ toolkit/mozapps/update/UpdateListener.jsm | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 04c8c68c228d..66eacc69e305 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -5820,6 +5820,16 @@ "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"], diff --git a/toolkit/mozapps/update/UpdateListener.jsm b/toolkit/mozapps/update/UpdateListener.jsm index f601aadd18fd..616696a8cfdd 100644 --- a/toolkit/mozapps/update/UpdateListener.jsm +++ b/toolkit/mozapps/update/UpdateListener.jsm @@ -101,7 +101,11 @@ var UpdateListener = { 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) {