Bug 1566398 - Remove expired scalar telemetry probes for Changes panel. r=gl
authorRazvan Caliman <rcaliman@mozilla.com>
Wed, 17 Jul 2019 18:29:36 +0000
changeset 483278 0f0b33abecd0eca3ff74f9742d8dd201783927cb
parent 483277 8091a0c9fafa90ba24d47d56aee4c75f4aa03024
child 483279 599ecdac4aa85a137d000f041c13fcd1447e8a29
push id36311
push usermalexandru@mozilla.com
push dateThu, 18 Jul 2019 15:52:27 +0000
treeherdermozilla-central@8442d3697272 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1566398
milestone70.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 1566398 - Remove expired scalar telemetry probes for Changes panel. r=gl Differential Revision: https://phabricator.services.mozilla.com/D38363
devtools/client/inspector/changes/ChangesView.js
devtools/client/inspector/changes/components/ChangesApp.js
devtools/client/inspector/changes/constants.js
toolkit/components/telemetry/Scalars.yaml
--- a/devtools/client/inspector/changes/ChangesView.js
+++ b/devtools/client/inspector/changes/ChangesView.js
@@ -22,21 +22,18 @@ loader.lazyRequireGetter(
   "clipboardHelper",
   "devtools/shared/platform/clipboard"
 );
 
 const ChangesApp = createFactory(require("./components/ChangesApp"));
 const { getChangesStylesheet } = require("./selectors/changes");
 
 const {
-  TELEMETRY_SCALAR_CONTEXTMENU,
-  TELEMETRY_SCALAR_CONTEXTMENU_COPY,
   TELEMETRY_SCALAR_CONTEXTMENU_COPY_DECLARATION,
   TELEMETRY_SCALAR_CONTEXTMENU_COPY_RULE,
-  TELEMETRY_SCALAR_COPY,
   TELEMETRY_SCALAR_COPY_ALL_CHANGES,
   TELEMETRY_SCALAR_COPY_RULE,
 } = require("./constants");
 
 const { resetChanges, trackChange } = require("./actions/changes");
 
 class ChangesView {
   constructor(inspector, window) {
@@ -45,17 +42,16 @@ class ChangesView {
     this.store = this.inspector.store;
     this.telemetry = this.inspector.telemetry;
     this.window = window;
 
     this.onAddChange = this.onAddChange.bind(this);
     this.onClearChanges = this.onClearChanges.bind(this);
     this.onChangesFront = this.onChangesFront.bind(this);
     this.onContextMenu = this.onContextMenu.bind(this);
-    this.onCopy = this.onCopy.bind(this);
     this.onCopyAllChanges = this.copyAllChanges.bind(this);
     this.onCopyRule = this.copyRule.bind(this);
     this.destroy = this.destroy.bind(this);
 
     this.init();
   }
 
   get contextMenu() {
@@ -64,17 +60,16 @@ class ChangesView {
     }
 
     return this._contextMenu;
   }
 
   init() {
     const changesApp = ChangesApp({
       onContextMenu: this.onContextMenu,
-      onCopy: this.onCopy,
       onCopyAllChanges: this.onCopyAllChanges,
       onCopyRule: this.onCopyRule,
     });
 
     // listen to the front for initialization, add listeners
     // when it is ready
     this._getChangesFront();
 
@@ -206,17 +201,16 @@ class ChangesView {
   }
 
   /**
    * Handler for the "Copy" option from the context menu.
    * Copies the current text selection to the clipboard.
    */
   copySelection() {
     clipboardHelper.copyString(this.window.getSelection().toString());
-    this.telemetry.scalarAdd(TELEMETRY_SCALAR_CONTEXTMENU_COPY, 1);
   }
 
   onAddChange(change) {
     // Turn data into a suitable change to send to the store.
     this.store.dispatch(trackChange(change));
   }
 
   onClearChanges() {
@@ -224,25 +218,16 @@ class ChangesView {
   }
 
   /**
    * Event handler for the "contextmenu" event fired when the context menu is requested.
    * @param {Event} e
    */
   onContextMenu(e) {
     this.contextMenu.show(e);
-    this.telemetry.scalarAdd(TELEMETRY_SCALAR_CONTEXTMENU, 1);
-  }
-
-  /**
-   * Event handler for the "copy" event fired when content is copied to the clipboard.
-   * We don't change the default behavior. We only log the increment count of this action.
-   */
-  onCopy() {
-    this.telemetry.scalarAdd(TELEMETRY_SCALAR_COPY, 1);
   }
 
   /**
    * Destruction function called when the inspector is destroyed.
    */
   async destroy() {
     this.store.dispatch(resetChanges());
 
--- a/devtools/client/inspector/changes/components/ChangesApp.js
+++ b/devtools/client/inspector/changes/components/ChangesApp.js
@@ -19,18 +19,16 @@ const { getStr } = require("../utils/l10
 
 class ChangesApp extends PureComponent {
   static get propTypes() {
     return {
       // Nested CSS rule tree structure of CSS changes grouped by source (stylesheet)
       changesTree: PropTypes.object.isRequired,
       // Event handler for "contextmenu" event
       onContextMenu: PropTypes.func.isRequired,
-      // Event handler for "copy" event
-      onCopy: PropTypes.func.isRequired,
       // Event handler for click on "Copy All Changes" button
       onCopyAllChanges: PropTypes.func.isRequired,
       // Event handler for click on "Copy Rule" button
       onCopyRule: PropTypes.func.isRequired,
     };
   }
 
   constructor(props) {
@@ -216,17 +214,16 @@ class ChangesApp extends PureComponent {
 
   render() {
     const hasChanges = Object.keys(this.props.changesTree).length > 0;
     return dom.div(
       {
         className: "theme-sidebar inspector-tabpanel",
         id: "sidebar-panel-changes",
         onContextMenu: this.props.onContextMenu,
-        onCopy: this.props.onCopy,
       },
       !hasChanges && this.renderEmptyState(),
       hasChanges && this.renderCopyAllChangesButton(),
       hasChanges && this.renderDiff(this.props.changesTree)
     );
   }
 }
 
--- a/devtools/client/inspector/changes/constants.js
+++ b/devtools/client/inspector/changes/constants.js
@@ -2,18 +2,15 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* 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";
 
 module.exports = {
-  TELEMETRY_SCALAR_CONTEXTMENU: "devtools.changesview.contextmenu",
-  TELEMETRY_SCALAR_CONTEXTMENU_COPY: "devtools.changesview.contextmenu_copy",
   TELEMETRY_SCALAR_CONTEXTMENU_COPY_DECLARATION:
     "devtools.changesview.contextmenu_copy_declaration",
   TELEMETRY_SCALAR_CONTEXTMENU_COPY_RULE:
     "devtools.changesview.contextmenu_copy_rule",
-  TELEMETRY_SCALAR_COPY: "devtools.changesview.copy",
   TELEMETRY_SCALAR_COPY_ALL_CHANGES: "devtools.changesview.copy_all_changes",
   TELEMETRY_SCALAR_COPY_RULE: "devtools.changesview.copy_rule",
 };
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -2304,34 +2304,16 @@ devtools.changesview:
     release_channel_collection: opt-out
     products:
       - 'firefox'
       - 'fennec'
       - 'geckoview'
     record_in_processes:
       - 'main'
 
-  copy:
-    bug_numbers:
-      - 1522843
-    description: >
-      Number of times any text content from the Changes panel is copied to the clipboard.
-    expires: "69"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org
-      - mbalfanz@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - 'main'
-
   copy_all_changes:
     bug_numbers:
       - 1532583
     description: >
       Number of times the Copy All Changes button is used in the Changes panel.
     expires: "70"
     kind: uint
     notification_emails:
@@ -2358,52 +2340,16 @@ devtools.changesview:
     release_channel_collection: opt-out
     products:
       - 'firefox'
       - 'fennec'
       - 'geckoview'
     record_in_processes:
       - 'main'
 
-  contextmenu:
-    bug_numbers:
-      - 1522843
-    description: >
-      Number of times the Changes panel context menu is shown.
-    expires: "69"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org
-      - mbalfanz@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - 'main'
-
-  contextmenu_copy:
-    bug_numbers:
-      - 1522843
-    description: >
-      Number of times the Copy option is picked from the Changes panel context menu.
-    expires: "69"
-    kind: uint
-    notification_emails:
-      - dev-developer-tools@lists.mozilla.org
-      - mbalfanz@mozilla.com
-    release_channel_collection: opt-out
-    products:
-      - 'firefox'
-      - 'fennec'
-      - 'geckoview'
-    record_in_processes:
-      - 'main'
-
   contextmenu_copy_declaration:
     bug_numbers:
       - 1532583
     description: >
       Number of times the Copy Declaration option is picked from the Changes panel
       context menu.
     expires: "70"
     kind: uint