Bug 1463092 - Instrument inspection of 'Jump to Source' in the Web Console with event telemetry r=jdescottes

MozReview-Commit-ID: DF54uBCDX1n

--HG--
extra : rebase_source : e1466cc046a5cd5a211bbc39a050fc40df9b4522
This commit is contained in:
Michael Ratcliffe 2018-06-22 16:56:51 +01:00
parent 8ff298bb4c
commit 4e428a3269
2 changed files with 28 additions and 7 deletions

View File

@ -35,7 +35,7 @@ function WebConsoleOutputWrapper(parentNode, hud, toolbox, owner, document) {
this.queuedRequestUpdates = []; this.queuedRequestUpdates = [];
this.throttledDispatchPromise = null; this.throttledDispatchPromise = null;
this._telemetry = new Telemetry(); this.telemetry = new Telemetry();
store = configureStore(this.hud); store = configureStore(this.hud);
} }
@ -163,18 +163,29 @@ WebConsoleOutputWrapper.prototype = {
if (this.toolbox) { if (this.toolbox) {
Object.assign(serviceContainer, { Object.assign(serviceContainer, {
onViewSourceInDebugger: frame => { onViewSourceInDebugger: frame => {
this.toolbox.viewSourceInDebugger(frame.url, frame.line).then(() => this.toolbox.viewSourceInDebugger(frame.url, frame.line).then(() => {
this.hud.emit("source-in-debugger-opened") 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( onViewSourceInScratchpad: frame => this.toolbox.viewSourceInScratchpad(
frame.url, frame.url,
frame.line frame.line
), ).then(() => {
this.telemetry.recordEvent("devtools.main", "jump_to_source", "webconsole",
null, { "session_id": this.toolbox.sessionId }
);
}),
onViewSourceInStyleEditor: frame => this.toolbox.viewSourceInStyleEditor( onViewSourceInStyleEditor: frame => this.toolbox.viewSourceInStyleEditor(
frame.url, frame.url,
frame.line frame.line
), ).then(() => {
this.telemetry.recordEvent("devtools.main", "jump_to_source", "webconsole",
null, { "session_id": this.toolbox.sessionId }
);
}),
openNetworkPanel: (requestId) => { openNetworkPanel: (requestId) => {
return this.toolbox.selectTool("netmonitor").then((panel) => { return this.toolbox.selectTool("netmonitor").then((panel) => {
return panel.panelWin.Netmonitor.inspectRequest(requestId); return panel.panelWin.Netmonitor.inspectRequest(requestId);
@ -393,7 +404,7 @@ WebConsoleOutputWrapper.prototype = {
store.dispatch(actions.messagesAdd(this.queuedMessageAdds)); store.dispatch(actions.messagesAdd(this.queuedMessageAdds));
const length = this.queuedMessageAdds.length; const length = this.queuedMessageAdds.length;
this._telemetry.addEventProperty( this.telemetry.addEventProperty(
"devtools.main", "enter", "webconsole", null, "message_count", length); "devtools.main", "enter", "webconsole", null, "message_count", length);
this.queuedMessageAdds = []; this.queuedMessageAdds = [];

View File

@ -598,3 +598,13 @@ devtools.main:
expiry_version: never expiry_version: never
extra_keys: extra_keys:
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123. 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.