Bug 1281602 - rework automigration telemetry to use an enumerated histogram, r?bsmedberg draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 23 Jun 2016 10:02:59 +0100
changeset 380788 34134ccfb413eae7d25c811008a8dc647dbbeba4
parent 380787 fdb3ad8a3429079cb23cddd4a003b03043a95728
child 523815 9a409fa89e2750e3755c36c77049f5565cdc4894
push id21321
push usergijskruitbosch@gmail.com
push dateThu, 23 Jun 2016 09:03:29 +0000
reviewersbsmedberg
bugs1281602
milestone50.0a1
Bug 1281602 - rework automigration telemetry to use an enumerated histogram, r?bsmedberg MozReview-Commit-ID: 37XarohGgMN
browser/components/migration/AutoMigrate.jsm
toolkit/components/telemetry/Histograms.json
--- 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,