Bug 1577317 - Add telemetry for "fix update directory permissions". r=rstrong a=lizzard
authorAdam Gashlin <agashlin@mozilla.com>
Fri, 20 Sep 2019 17:11:11 +0000
changeset 555351 42692bbe0a2525e65aba2e52597f44fad5713243
parent 555350 b7d9fad2146028e288f40557431805e2cd8874fd
child 555352 870f8e24fea4e78bf5c2e6814d17cf23673b32f1
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong, lizzard
bugs1577317
milestone70.0
Bug 1577317 - Add telemetry for "fix update directory permissions". r=rstrong a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D46241
toolkit/components/telemetry/Scalars.yaml
toolkit/mozapps/update/UpdateService.jsm
toolkit/mozapps/update/UpdateTelemetry.jsm
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -3402,16 +3402,34 @@ update:
       - 'firefox'
       - 'fennec'
       - 'geckoview'
     record_in_processes:
       - main
     operating_systems:
       - windows
 
+  fix_permissions_attempted:
+    bug_numbers:
+      - 1577317
+    description: Set when we attempt to fix update directory permissions.
+    expires: "76"
+    kind: boolean
+    notification_emails:
+      - application-update-telemetry-alerts@mozilla.com
+      - agashlin@mozilla.com
+      - rstrong@mozilla.com
+    release_channel_collection: opt-out
+    products:
+      - 'firefox'
+    record_in_processes:
+      - main
+    operating_systems:
+      - windows
+
 update.startup:
   from_app_version:
     bug_numbers:
       - 1539154
     description: >
       Records the previous application version that the update was applied to
       when the update makes it to the last phase where the application has
       exited and started.
--- a/toolkit/mozapps/update/UpdateService.jsm
+++ b/toolkit/mozapps/update/UpdateService.jsm
@@ -1387,16 +1387,18 @@ function fixUpdateDirectoryPermissions()
         "permissions on this platform"
     );
     return false;
   }
 
   if (!gUpdateDirPermissionFixAttempted) {
     // Never try to fix permissions more than one time during a session.
     gUpdateDirPermissionFixAttempted = true;
+    AUSTLMY.pingFixUpdateDirectoryPermissionsAttempted();
+
     LOG("Attempting to fix update directory permissions");
     try {
       Cc["@mozilla.org/updates/update-processor;1"]
         .createInstance(Ci.nsIUpdateProcessor)
         .fixUpdateDirectoryPerms(shouldUseService());
     } catch (e) {
       LOG(
         "Attempt to fix update directory permissions failed. Exception: " + e
--- a/toolkit/mozapps/update/UpdateTelemetry.jsm
+++ b/toolkit/mozapps/update/UpdateTelemetry.jsm
@@ -638,16 +638,28 @@ var AUSTLMY = {
         Services.telemetry.getHistogramById(id).add();
       }
     } catch (e) {
       Cu.reportError(e);
     }
   },
 
   /**
+   * Submit a telemetry ping for a boolean scalar when we attempt to fix
+   * the update directory permissions this session.
+   */
+  pingFixUpdateDirectoryPermissionsAttempted: function UT_PFUDPA() {
+    try {
+      Services.telemetry.scalarSet("update.fix_permissions_attempted", true);
+    } catch (e) {
+      Cu.reportError(e);
+    }
+  },
+
+  /**
    * Submit a telemetry ping for a count type histogram when the expected value
    * does not equal the boolean value of a pref or if the pref isn't present
    * when the expected value does not equal default value. This lessens the
    * amount of data submitted to telemetry.
    *
    * @param  aID
    *         The histogram ID to report to.
    * @param  aPref