Bug 1463092 - Instrument inspection of 'Jump to Source' in the Web Console with event telemetry r?jdescottes
MozReview-Commit-ID: DF54uBCDX1n
--- a/devtools/client/webconsole/webconsole-output-wrapper.js
+++ b/devtools/client/webconsole/webconsole-output-wrapper.js
@@ -30,17 +30,17 @@ function WebConsoleOutputWrapper(parentN
this.init = this.init.bind(this);
this.queuedMessageAdds = [];
this.queuedMessageUpdates = [];
this.queuedRequestUpdates = [];
this.throttledDispatchPromise = null;
- this._telemetry = new Telemetry();
+ this.telemetry = new Telemetry();
store = configureStore(this.hud);
}
WebConsoleOutputWrapper.prototype = {
init: function() {
return new Promise((resolve) => {
const attachRefToHud = (id, node) => {
@@ -158,28 +158,39 @@ WebConsoleOutputWrapper.prototype = {
menu.popup(screenX, screenY, { doc: this.owner.chromeWindow.document });
return menu;
};
if (this.toolbox) {
Object.assign(serviceContainer, {
onViewSourceInDebugger: frame => {
- this.toolbox.viewSourceInDebugger(frame.url, frame.line).then(() =>
- this.hud.emit("source-in-debugger-opened")
- );
+ this.toolbox.viewSourceInDebugger(frame.url, frame.line).then(() => {
+ this.telemetry.recordEvent("devtools.main", "jump_to_source", "webconsole",
+ null, { "session_id": this.toolbox.sessionId }
+ );
+ this.hud.emit("source-in-debugger-opened");
+ });
},
onViewSourceInScratchpad: frame => this.toolbox.viewSourceInScratchpad(
frame.url,
frame.line
- ),
+ ).then(() => {
+ this.telemetry.recordEvent("devtools.main", "jump_to_source", "webconsole",
+ null, { "session_id": this.toolbox.sessionId }
+ );
+ }),
onViewSourceInStyleEditor: frame => this.toolbox.viewSourceInStyleEditor(
frame.url,
frame.line
- ),
+ ).then(() => {
+ this.telemetry.recordEvent("devtools.main", "jump_to_source", "webconsole",
+ null, { "session_id": this.toolbox.sessionId }
+ );
+ }),
openNetworkPanel: (requestId) => {
return this.toolbox.selectTool("netmonitor").then((panel) => {
return panel.panelWin.Netmonitor.inspectRequest(requestId);
});
},
sourceMapService: this.toolbox ? this.toolbox.sourceMapURLService : null,
highlightDomElement: (grip, options = {}) => {
return this.toolbox.highlighterUtils
@@ -388,17 +399,17 @@ WebConsoleOutputWrapper.prototype = {
this.throttledDispatchPromise = new Promise(done => {
setTimeout(() => {
this.throttledDispatchPromise = null;
store.dispatch(actions.messagesAdd(this.queuedMessageAdds));
const length = this.queuedMessageAdds.length;
- this._telemetry.addEventProperty(
+ this.telemetry.addEventProperty(
"devtools.main", "enter", "webconsole", null, "message_count", length);
this.queuedMessageAdds = [];
if (this.queuedMessageUpdates.length > 0) {
this.queuedMessageUpdates.forEach(({ message, res }) => {
store.dispatch(actions.networkMessageUpdate(message, null, res));
this.hud.emit("network-message-updated", res);
--- a/toolkit/components/telemetry/Events.yaml
+++ b/toolkit/components/telemetry/Events.yaml
@@ -593,8 +593,18 @@ devtools.main:
bug_numbers: [1463126]
notification_emails: ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"]
record_in_processes: ["main"]
description: User clicked the blackbox button to blackbox a script.
release_channel_collection: opt-out
expiry_version: never
extra_keys:
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
+ jump_to_source:
+ objects: ["webconsole"]
+ bug_numbers: [1463092]
+ notification_emails: ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"]
+ record_in_processes: ["main"]
+ description: User has clicked a link to a source file in the web console.
+ release_channel_collection: opt-out
+ expiry_version: never
+ extra_keys:
+ session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.