Bug 1471194 - Remove the expiring scalar Telemetry probe 'worker_restart_count', since it has served its purpose well. r?liuche
We've been able to validate that the sessionstore worker restarts, as implemented
in
bug 1402267, are working as expected and that worker threads are indeed _not_
infallible during the main process' lifetime.
MozReview-Commit-ID: Le8AJhlWMn8
--- a/browser/components/sessionstore/SessionFile.jsm
+++ b/browser/components/sessionstore/SessionFile.jsm
@@ -362,17 +362,16 @@ var SessionFileInternal = {
_checkWorkerHealth() {
if (this._workerHealth.failures >= kMaxWriteFailures) {
SessionWorker.terminate();
// Flag as not-initialized, to ensure that the worker state init is performed
// upon the next request.
this._initializationStarted = false;
// Reset the counter and report to telemetry.
this._workerHealth.failures = 0;
- Telemetry.scalarAdd("browser.session.restore.worker_restart_count", 1);
}
},
write(aData) {
if (RunState.isClosed) {
return Promise.reject(new Error("SessionFile is closed"));
}
deleted file mode 100644
--- a/browser/components/sessionstore/test/unit/test_scalar_worker_restarts.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * The primary purpose of this test is to ensure that the sessionstore component
- * records information about erroneous workers into a scalar.
- */
-
-"use strict";
-const Telemetry = Services.telemetry;
-const ScalarId = "browser.session.restore.worker_restart_count";
-
-// Prepare the session file.
-var profd = do_get_profile();
-ChromeUtils.import("resource:///modules/sessionstore/SessionFile.jsm", this);
-
-/**
- * In order to use browser.session.restore.worker_restart_count scalar, it has
- * to be registered in "toolkit/components/telemetry/Scalars.yaml".
- * This test ensures that the scalar is registered and empty.
- */
-add_task(async function test_ensure_scalar_is_empty() {
- const scalars = Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT, false).parent || {};
- Assert.ok(!(ScalarId in scalars), "Sanity check; no scalars should be there yet.");
-});
-
-/**
- * Makes sure that the scalar is positively updated when amount of failures
- * becomes higher than the threshold.
- */
-add_task(async function test_worker_restart() {
- let backstagePass = ChromeUtils.import("resource:///modules/sessionstore/SessionFile.jsm", {});
- backstagePass.SessionFileInternal._workerHealth.failures = backstagePass.kMaxWriteFailures + 1;
- backstagePass.SessionFileInternal._checkWorkerHealth();
-
- Assert.equal(backstagePass.SessionFileInternal._workerHealth.failures, 0,
- "Worker failure count should've been reset.");
-
- // Checking if the scalar is positively updated.
- const scalars = Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT, false).parent;
- Assert.equal(scalars[ScalarId], 1, "Should be increased with one hit.");
-});
--- a/browser/components/sessionstore/test/unit/xpcshell.ini
+++ b/browser/components/sessionstore/test/unit/xpcshell.ini
@@ -5,13 +5,12 @@ skip-if = toolkit == 'android'
support-files =
data/sessionCheckpoints_all.json
data/sessionstore_invalid.js
data/sessionstore_valid.js
[test_backup_once.js]
[test_histogram_corrupt_files.js]
[test_migration_lz4compression.js]
-[test_scalar_worker_restarts.js]
[test_shutdown_cleanup.js]
[test_startup_nosession_async.js]
[test_startup_session_async.js]
[test_startup_invalid_session.js]
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -358,34 +358,16 @@ browser.usage:
kind: uint
notification_emails:
- bsmedberg@mozilla.com
release_channel_collection: opt-out
record_in_processes:
- 'main'
- 'content'
-# The following section contains the session restore scalars.
-browser.session.restore:
- worker_restart_count:
- bug_numbers:
- - 1402267
- description: >
- A counter incremented every time the SessionFile worker is restarted due
- to too many failures, as defined in the browser.sessionstore.max_write_failures
- pref.
- expires: "64"
- kind: uint
- notification_emails:
- - mdeboer@mozilla.com
- - session-restore-telemetry-alerts@mozilla.com
- release_channel_collection: opt-out
- record_in_processes:
- - 'main'
-
extensions.updates:
rdf:
bug_numbers:
- 1460336
description: >
The number of RDF update requsts for a given extension ID.
expires: "66"
kind: uint