Bug 1601993 - Add Telemetry for the slow startup notification bar. r=jaws, data-review=mmccorquodale

Differential Revision: https://phabricator.services.mozilla.com/D64664

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Conley 2020-02-27 22:17:45 +00:00
parent c46f314546
commit 592e47fdab
2 changed files with 139 additions and 5 deletions

View File

@ -1249,14 +1249,23 @@ BrowserGlue.prototype = {
},
_trackSlowStartup() {
if (
Services.startup.interrupted ||
Services.prefs.getBoolPref("browser.slowStartup.notificationDisabled")
) {
let disabled = Services.prefs.getBoolPref(
"browser.slowStartup.notificationDisabled"
);
Services.telemetry.scalarSet(
"browser.startup.slow_startup_notification_disabled",
disabled
);
if (Services.startup.interrupted || disabled) {
return;
}
let currentTime = Math.round(Cu.now());
Services.telemetry.scalarSet("browser.startup.recorded_time", currentTime);
let averageTime = 0;
let samples = 0;
try {
@ -1270,6 +1279,8 @@ BrowserGlue.prototype = {
samples++;
averageTime = totalTime / samples;
Services.telemetry.scalarSet("browser.startup.average_time", averageTime);
if (
samples >= Services.prefs.getIntPref("browser.slowStartup.maxSamples")
) {
@ -1311,6 +1322,10 @@ BrowserGlue.prototype = {
_showSlowStartupNotification(profileAge) {
if (profileAge < 90) {
// 3 months
Services.telemetry.scalarSet(
"browser.startup.too_new_for_notification",
true
);
return;
}
@ -1319,6 +1334,15 @@ BrowserGlue.prototype = {
return;
}
Services.telemetry.scalarSet("browser.startup.slow_startup_notified", true);
const NO_ACTION = 0;
const OPENED_SUMO = 1;
const NEVER_SHOW_AGAIN = 2;
const DISMISS_NOTIFICATION = 3;
Services.telemetry.scalarSet("browser.startup.action", NO_ACTION);
let productName = gBrandBundle.GetStringFromName("brandFullName");
let message = win.gNavigatorBundle.getFormattedString(
"slowStartup.message",
@ -1332,6 +1356,7 @@ BrowserGlue.prototype = {
"slowStartup.helpButton.accesskey"
),
callback() {
Services.telemetry.scalarSet("browser.startup.action", OPENED_SUMO);
win.openTrustedLinkIn(
"https://support.mozilla.org/kb/reset-firefox-easily-fix-most-problems",
"tab"
@ -1346,6 +1371,10 @@ BrowserGlue.prototype = {
"slowStartup.disableNotificationButton.accesskey"
),
callback() {
Services.telemetry.scalarSet(
"browser.startup.action",
NEVER_SHOW_AGAIN
);
Services.prefs.setBoolPref(
"browser.slowStartup.notificationDisabled",
true
@ -1354,12 +1383,22 @@ BrowserGlue.prototype = {
},
];
let closeCallback = closeType => {
if (closeType == "dismissed") {
Services.telemetry.scalarSet(
"browser.startup.action",
DISMISS_NOTIFICATION
);
}
};
win.gNotificationBox.appendNotification(
message,
"slow-startup",
"chrome://browser/skin/slowStartup-16.png",
win.gNotificationBox.PRIORITY_INFO_LOW,
buttons
buttons,
closeCallback
);
},

View File

@ -443,6 +443,101 @@ browser.engagement.navigation:
record_in_processes:
- 'main'
browser.startup:
slow_startup_notification_disabled:
bug_numbers:
- 1601993
description:
Whether the slow startup notification bar is disabled for the user.
expires: "78"
kind: boolean
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
too_new_for_notification:
bug_numbers:
- 1601993
description:
Whether the slow startup notification bar was suppressed because the profile is too new.
expires: "78"
kind: boolean
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
slow_startup_notified:
bug_numbers:
- 1601993
description:
Whether the slow startup notification bar was shown to the user during this session.
expires: "78"
kind: boolean
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
recorded_time:
bug_numbers:
- 1601993
description: >
The startup time computed by the slow startup notification bar in milliseconds.
expires: "78"
kind: uint
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
average_time:
bug_numbers:
- 1601993
description: >
The average startup time computed by the slow startup notification bar in milliseconds.
expires: "78"
kind: uint
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
action:
bug_numbers:
- 1601993
description: >
The action that the user took with the slow startup notification bar.
0: No action (default)
1: User chose to open SUMO document on slow startup
2: User chose to never show the notification bar again
3: User dismissed the notification bar
expires: "78"
kind: uint
notification_emails:
- mconley@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
# The following section contains the browser usage scalars.
browser.usage:
graphite: