зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1666545 - Move Places telemetry collection to the first idle. r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D96479
This commit is contained in:
Родитель
fff551e1dd
Коммит
ec6b6d8b57
|
@ -1281,6 +1281,9 @@ BrowserGlue.prototype = {
|
|||
if (AppConstants.platform == "win") {
|
||||
JawsScreenReaderVersionCheck.init();
|
||||
}
|
||||
|
||||
// This value is to limit collecting Places telemetry once per session.
|
||||
this._placesTelemetryGathered = false;
|
||||
},
|
||||
|
||||
// cleanup (called on application shutdown)
|
||||
|
@ -1908,6 +1911,13 @@ BrowserGlue.prototype = {
|
|||
|
||||
this._collectFirstPartyIsolationTelemetry();
|
||||
|
||||
if (!this._placesTelemetryGathered) {
|
||||
Cc["@mozilla.org/places/categoriesStarter;1"]
|
||||
.getService(Ci.nsIObserver)
|
||||
.observe(null, "gather-places-telemetry", null);
|
||||
this._placesTelemetryGathered = true;
|
||||
}
|
||||
|
||||
// Set the default favicon size for UI views that use the page-icon protocol.
|
||||
PlacesUtils.favicons.setDefaultIconURIPreferredSize(
|
||||
16 * aWindow.devicePixelRatio
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// Fired by TelemetryController when async telemetry data should be collected.
|
||||
const TOPIC_GATHER_TELEMETRY = "gather-telemetry";
|
||||
// Fired by BrowserGlue._onFirstWindowLoaded when async telemetry data should
|
||||
// be collected.
|
||||
const TOPIC_GATHER_TELEMETRY = "gather-places-telemetry";
|
||||
|
||||
// Seconds between maintenance runs.
|
||||
const MAINTENANCE_INTERVAL_SECONDS = 7 * 86400;
|
||||
|
@ -42,7 +43,10 @@ PlacesCategoriesStarter.prototype = {
|
|||
}
|
||||
break;
|
||||
case TOPIC_GATHER_TELEMETRY:
|
||||
PlacesDBUtils.telemetry();
|
||||
// Collect Places telemetry on the first idle.
|
||||
Services.tm.idleDispatchToMainThread(() => {
|
||||
PlacesDBUtils.telemetry();
|
||||
});
|
||||
break;
|
||||
case "idle-daily":
|
||||
// Once a week run places.sqlite maintenance tasks.
|
||||
|
|
|
@ -99,10 +99,10 @@ add_task(async function test_execute() {
|
|||
annotations: new Map([["test-anno", content]]),
|
||||
});
|
||||
|
||||
// Request to gather telemetry data.
|
||||
// Request to gather Places telemetry data.
|
||||
Cc["@mozilla.org/places/categoriesStarter;1"]
|
||||
.getService(Ci.nsIObserver)
|
||||
.observe(null, "gather-telemetry", null);
|
||||
.observe(null, "gather-places-telemetry", null);
|
||||
|
||||
await PlacesTestUtils.promiseAsyncUpdates();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче