Bug 1366808: Add telemetry probe for about:restartrequired page. r=jimm,chutten

This commit is contained in:
Stephen A Pohl 2018-05-08 10:31:59 -04:00
Родитель 8d4b0ba4b7
Коммит 339982e013
4 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -322,6 +322,12 @@ var TabCrashHandler = {
browser.docShell.displayLoadError(Cr.NS_ERROR_BUILDID_MISMATCH, uri, null);
tab.setAttribute("crashed", true);
// Make sure to only count once even if there are multiple windows
// that will all show about:restartrequired.
if (this._crashedTabCount == 1) {
Services.telemetry.scalarAdd("dom.contentprocess.buildID_mismatch", 1);
}
},
/**

Просмотреть файл

@ -50,3 +50,4 @@ support-files =
usageTelemetrySearchSuggestions.xml
[browser_UsageTelemetry_content.js]
[browser_UsageTelemetry_content_aboutHome.js]
[browser_UsageTelemetry_content_aboutRestartRequired.js]

Просмотреть файл

@ -0,0 +1,30 @@
"use strict";
const SCALAR_BUILDID_MISMATCH = "dom.contentprocess.buildID_mismatch";
add_task(async function test_aboutRestartRequired() {
let CrashHandlers = {};
ChromeUtils.import("resource:///modules/ContentCrashHandlers.jsm",
CrashHandlers);
// Let's reset the counts.
Services.telemetry.clearScalars();
let scalars =
getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
// Check preconditions
is(scalars[SCALAR_BUILDID_MISMATCH], undefined,
"Build ID mismatch count should be undefined");
// Simulate buildID mismatch
CrashHandlers.TabCrashHandler._crashedTabCount = 1;
CrashHandlers.TabCrashHandler.sendToRestartRequiredPage(
gBrowser.selectedTab.linkedBrowser);
scalars =
getParentProcessScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT);
is(scalars[SCALAR_BUILDID_MISMATCH], 1,
"Build ID mismatch count should be 1.");
});

Просмотреть файл

@ -776,6 +776,20 @@ dom.contentprocess:
record_in_processes:
- 'main'
buildID_mismatch:
bug_numbers:
- 1366808
description: >
The number of times the about:restartrequired page appeared due to a
buildID mismatch between the parent and the content processes.
expires: never
kind: uint
notification_emails:
- spohl@mozilla.com
release_channel_collection: opt-out
record_in_processes:
- 'main'
devtools.toolbar.eyedropper:
opened:
bug_numbers: