From 36731b4fb2b4dbd9aeefb1430ebd11189cb4adf0 Mon Sep 17 00:00:00 2001 From: Razvan Caliman Date: Fri, 17 May 2019 16:42:48 +0000 Subject: [PATCH] Bug 1550794 - Add telemetry probe to count number of node selections. r=gl Adds a new permanent telemetry probe (scalar) to count the number of times a node selection is made in the Inspector. This count will be correlated with other existing probes (open count, duration open) to establish a more accurate baseline for Inspector usage and correct for accidental usage. When opening the Inspector via the context menu ("Inspect Element"), the selection is counted twice: once when automatically selecting the `` to build the dom tree and once more for selecting the actual target node. This side-effect does not pollute our data. We assign a higher weight to the behavior of "Inspect Element" as being intentional usage of the Inspector so the higher node selection count works in our favor. Differential Revision: https://phabricator.services.mozilla.com/D31231 --HG-- extra : moz-landing-system : lando --- devtools/client/inspector/inspector.js | 2 ++ toolkit/components/telemetry/Scalars.yaml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/devtools/client/inspector/inspector.js b/devtools/client/inspector/inspector.js index c1b04e9ce450c..0054f99bbfbc3 100644 --- a/devtools/client/inspector/inspector.js +++ b/devtools/client/inspector/inspector.js @@ -55,6 +55,7 @@ const THREE_PANE_ENABLED_PREF = "devtools.inspector.three-pane-enabled"; const THREE_PANE_ENABLED_SCALAR = "devtools.inspector.three_pane_enabled"; const THREE_PANE_CHROME_ENABLED_PREF = "devtools.inspector.chrome.three-pane-enabled"; const TELEMETRY_EYEDROPPER_OPENED = "devtools.toolbar.eyedropper.opened"; +const TELEMETRY_SCALAR_NODE_SELECTION_COUNT = "devtools.inspector.node_selection_count"; /** * Represents an open instance of the Inspector for a tab. @@ -1299,6 +1300,7 @@ Inspector.prototype = { executeSoon(() => { try { selfUpdate(this.selection.nodeFront); + this.telemetry.scalarAdd(TELEMETRY_SCALAR_NODE_SELECTION_COUNT, 1); } catch (ex) { console.error(ex); } diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml index 0d5318528bcbb..41063d28f3a3f 100644 --- a/toolkit/components/telemetry/Scalars.yaml +++ b/toolkit/components/telemetry/Scalars.yaml @@ -1433,6 +1433,21 @@ devtools.inspector: record_in_processes: - 'main' + node_selection_count: + bug_numbers: + - 1550794 + description: > + Number of times a different node is marked as selected in the Inspector regardless + of the cause: context menu, manual selection in markup view, etc. + expires: "never" + kind: uint + notification_emails: + - dev-developer-tools@lists.mozilla.org + - mbalfanz@mozilla.com + release_channel_collection: opt-out + record_in_processes: + - 'main' + devtools.shadowdom: shadow_root_displayed: bug_numbers: