Bug 1432897 - Add count for number of policies to telemetry. r=mconley a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Tue, 07 Jan 2020 15:05:15 +0000
changeset 524416 1d4968094d070defcc183b6587fe8594f385b8b6
parent 524415 78faebfaa7d90e1ae4515c2e92aae9476a016ac6
child 524417 27f71a0b7aa25c9e17bd0e9eebbd9ffab2df6b81
push id765
push userryanvm@gmail.com
push dateTue, 14 Jan 2020 22:56:39 +0000
treeherdermozilla-esr68@3b3f5444c547 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, RyanVM
bugs1432897
milestone68.5.0
Bug 1432897 - Add count for number of policies to telemetry. r=mconley a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D54799
toolkit/components/enterprisepolicies/EnterprisePolicies.js
toolkit/components/telemetry/Scalars.yaml
--- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js
+++ b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
@@ -97,16 +97,20 @@ EnterprisePoliciesManager.prototype = {
 
     if (provider.failed) {
       this.status = Ci.nsIEnterprisePolicies.FAILED;
       return;
     }
 
     this.status = Ci.nsIEnterprisePolicies.ACTIVE;
     this._parsedPolicies = {};
+    Services.telemetry.scalarSet(
+      "policies.count",
+      Object.keys(provider.policies).length
+    );
     this._activatePolicies(provider.policies);
   },
 
   _chooseProvider() {
     let provider = null;
     if (AppConstants.platform == "win") {
       provider = new WindowsGPOPoliciesProvider();
     } else if (AppConstants.platform == "macosx") {
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -3771,16 +3771,33 @@ networking:
     expires: "73"
     keyed: false
     kind: uint
     notification_emails:
       - ddamjanovic@mozilla.com
     record_in_processes:
       - 'main'
 
+policies:
+  count:
+    bug_numbers:
+      - 1432897
+    description: >-
+      A uint with the number of active enterprise policies, collected once at
+      startup.
+    expires: never
+    kind: uint
+    notification_emails:
+      - mkaply@mozilla.com
+    release_channel_collection: opt-out
+    products:
+      - 'firefox'
+    record_in_processes:
+      - main
+
 # The following section is for probes testing the Telemetry system. They will not be
 # submitted in pings and are only used for testing.
 telemetry.test:
   unsigned_int_kind:
     bug_numbers:
       - 1276190
     description: >
       This is a test uint type with a really long description, maybe spanning even multiple