Bug 1281602 - rework automigration telemetry to use an enumerated histogram, r?bsmedberg
MozReview-Commit-ID: 37XarohGgMN
--- a/browser/components/migration/AutoMigrate.jsm
+++ b/browser/components/migration/AutoMigrate.jsm
@@ -20,45 +20,45 @@ const AutoMigrate = {
/**
* Automatically pick a migrator and resources to migrate,
* then migrate those and start up.
*
* @throws if automatically deciding on migrators/data
* failed for some reason.
*/
migrate(profileStartup, migratorKey, profileToMigrate) {
- let histogram = Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_SUCCEEDED");
- histogram.add("initialized");
+ let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_PROCESS_SUCCESS");
+ histogram.add(0);
let migrator = this.pickMigrator(migratorKey);
- histogram.add("got-browser");
+ histogram.add(4);
profileToMigrate = this.pickProfile(migrator, profileToMigrate);
- histogram.add("got-profile");
+ histogram.add(8);
let resourceTypes = migrator.getMigrateData(profileToMigrate, profileStartup);
if (!(resourceTypes & this.resourceTypesToUse)) {
throw new Error("No usable resources were found for the selected browser!");
}
- histogram.add("got-data");
+ histogram.add(10);
let sawErrors = false;
let migrationObserver = function(subject, topic, data) {
if (topic == "Migration:ItemError") {
sawErrors = true;
} else if (topic == "Migration:Ended") {
- histogram.add(sawErrors ? "finished-with-errors" : "finished");
+ histogram.add(sawErrors ? 18 : 19);
Services.obs.removeObserver(migrationObserver, "Migration:Ended");
Services.obs.removeObserver(migrationObserver, "Migration:ItemError");
}
};
Services.obs.addObserver(migrationObserver, "Migration:Ended", false);
Services.obs.addObserver(migrationObserver, "Migration:ItemError", false);
migrator.migrate(this.resourceTypesToUse, profileStartup, profileToMigrate);
- histogram.add("migrate-called-without-exceptions");
+ histogram.add(15);
},
/**
* Pick and return a migrator to use for automatically migrating.
*
* @param {String} migratorKey optional, a migrator key to prefer/pick.
* @returns the migrator to use for migrating.
*/
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4432,24 +4432,24 @@
"bug_numbers": [1275114],
"alert_emails": ["gijs@mozilla.com"],
"expires_in_version": "53",
"kind": "enumerated",
"n_values": 15,
"releaseChannelCollection": "opt-out",
"description": "The browser that was the default on the initial profile migration. The values correspond to the internal browser ID (see MigrationUtils.jsm)"
},
- "FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_SUCCEEDED": {
+ "FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_PROCESS_SUCCESS": {
"bug_numbers": [1271775],
"alert_emails": ["gijs@mozilla.com"],
"expires_in_version": "53",
- "kind": "count",
- "keyed": true,
- "releaseChannelCollection": "opt-out",
- "description": "Where automatic migration was attempted, indicates to what degree we succeeded."
+ "kind": "enumerated",
+ "n_values": 20,
+ "releaseChannelCollection": "opt-out",
+ "description": "Where automatic migration was attempted, indicates to what degree we succeeded. Values 0-17 indicate progress through the automatic migration sequence, 18 indicates some items had errors, and 19 indicates complete success."
},
"FX_STARTUP_MIGRATION_DATA_RECENCY": {
"bug_numbers": [1276694],
"alert_emails": ["gijs@mozilla.com"],
"expires_in_version": "53",
"keyed": true,
"kind": "exponential",
"n_buckets": 50,