Skip to content

Commit

Permalink
Bug 1550794 - Add telemetry probe to count number of node selections.…
Browse files Browse the repository at this point in the history
… 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 `<body>` 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
  • Loading branch information
oslego committed May 17, 2019
1 parent 8830549 commit 36731b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions devtools/client/inspector/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down
15 changes: 15 additions & 0 deletions toolkit/components/telemetry/Scalars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- [email protected]
- [email protected]
release_channel_collection: opt-out
record_in_processes:
- 'main'

devtools.shadowdom:
shadow_root_displayed:
bug_numbers:
Expand Down

0 comments on commit 36731b4

Please sign in to comment.