Bug 1548241 - add telemetry for audit filter activation in accessibility panel. r=jdescottes
authorYura Zenevich <yura.zenevich@gmail.com>
Wed, 01 May 2019 20:16:24 +0000
changeset 532268 c6dbde54689d42c29e2ff47fee4972bbd2433840
parent 532267 d8e0bfeb5fa39545f737a6979c94a210d947ab22
child 532269 8096d130b1346ba0c6bc10450de6f86196f3f768
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1548241
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1548241 - add telemetry for audit filter activation in accessibility panel. r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D29490
devtools/client/accessibility/components/AccessibilityTreeFilter.js
toolkit/components/telemetry/Scalars.yaml
--- a/devtools/client/accessibility/components/AccessibilityTreeFilter.js
+++ b/devtools/client/accessibility/components/AccessibilityTreeFilter.js
@@ -1,25 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 "use strict";
 
+/* global gTelemetry */
+
 // React
 const { createFactory, Component } = require("devtools/client/shared/vendor/react");
 const { div } = require("devtools/client/shared/vendor/react-dom-factories");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 const { L10N } = require("../utils/l10n");
 const ToggleButton = createFactory(require("./Button").ToggleButton);
 
 const actions = require("../actions/audit");
 
 const { connect } = require("devtools/client/shared/vendor/react-redux");
 const { FILTERS } = require("../constants");
 
+const TELEMETRY_AUDIT_ACTIVATED = "devtools.accessibility.audit_activated";
 const FILTER_LABELS = {
   [FILTERS.CONTRAST]: "accessibility.badge.contrast",
 };
 
 class AccessibilityTreeFilter extends Component {
   static get propTypes() {
     return {
       auditing: PropTypes.string.isRequired,
@@ -28,16 +31,20 @@ class AccessibilityTreeFilter extends Co
       walker: PropTypes.object.isRequired,
     };
   }
 
   async toggleFilter(filterKey) {
     const { dispatch, filters, walker } = this.props;
 
     if (!filters[filterKey]) {
+      if (gTelemetry) {
+        gTelemetry.keyedScalarAdd(TELEMETRY_AUDIT_ACTIVATED, filterKey, 1);
+      }
+
       dispatch(actions.auditing(filterKey));
       await dispatch(actions.audit(walker, filterKey));
     }
 
     // We wait to dispatch filter toggle until the tree is ready to be filtered
     // right after the audit. This is to make sure that we render an empty tree
     // (filtered) while the audit is running.
     dispatch(actions.filterToggle(filterKey));
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1719,16 +1719,33 @@ devtools.accessibility:
     keyed: true
     notification_emails:
       - dev-developer-tools@lists.mozilla.org
       - yzenevich@mozilla.com
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
 
+  audit_activated:
+    bug_numbers:
+      - 1548241
+    description: >
+      Number of times accessibility audit was activated (with mouse or keyboard)
+      from the accessibility panel's toolbar. Keyed by the audit filter type
+      (e.g. "CONTRAST").
+    expires: "73"
+    kind: uint
+    keyed: true
+    notification_emails:
+      - dev-developer-tools@lists.mozilla.org
+      - yzenevich@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+
 devtools.application:
   opened_count:
     bug_numbers:
       - 1451734
     description: >
       Number of times the DevTools Application panel has been opened.
     expires: "66"
     kind: uint