Closed
Bug 907755
Opened 11 years ago
Closed 11 years ago
add telemetry probe for how long it takes us to display the source text to the user
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: fitzgen, Assigned: b4bomsy)
Details
(Whiteboard: [good first bug][mentor=nfitzgerald@mozilla.com][lang=js])
Attachments
(2 files, 3 obsolete files)
3.86 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
2.73 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
Should start timing when the user selects an unfetched source and shouldn't report the probe until right after the source text is displayed.
Reporter | ||
Comment 1•11 years ago
|
||
This would be a good bug for someone who has already completed one or two other debugger bugs.
Priority: -- → P3
Whiteboard: [mentor=nfitzgerald@mozilla.com][lang=js]
Assignee | ||
Comment 2•11 years ago
|
||
Hi nick, Would like to work on this.
Reporter | ||
Comment 3•11 years ago
|
||
Sweet :) So we need a new telemetry probe. In the probe we should record the milliseconds frin when we first select a source in the debugger view, to right after the source is actually displayed to the user. https://developer.mozilla.org/en-US/docs/Performance/Adding_a_new_Telemetry_probe This isn't something we can really test super well, so just make sure that a) you can see results for the new probe in about:telemetry after you build and test the debugger on random web pages, and b) all the existing debugger tests pass.
Assignee: nobody → b4bomsy
Status: NEW → ASSIGNED
Reporter | ||
Comment 4•11 years ago
|
||
Search for DEVTOOLS_DEBUGGER_RDP for example probe definitions. I think we should actually define two probes here: one for local transports, another for remote transports.
Assignee | ||
Comment 5•11 years ago
|
||
ok..thanks. on it
Assignee | ||
Comment 6•11 years ago
|
||
i found that DEVTOOLS_DEBUGGER_RDP_LOCAL_SOURCES_MS and DEVTOOLS_DEBUGGER_RDP_REMOTE_SOURCES_MS have already being defined in http://mxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/Histograms.json I'm not sure if these can be used for the probes or should new ones be defined?
Reporter | ||
Comment 7•11 years ago
|
||
(In reply to Hubert B Manilla from comment #6) > i found that DEVTOOLS_DEBUGGER_RDP_LOCAL_SOURCES_MS and > DEVTOOLS_DEBUGGER_RDP_REMOTE_SOURCES_MS have already being defined in > http://mxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/ > Histograms.json > I'm not sure if these can be used for the probes or should new ones be > defined? Do not reuse these, they are for the request that gets a list of sources from the debugger rather than how long it takes to display a specific source to the user. I suggest adding something like DEVTOOLS_DEBUGGER_DISPLAY_SOURCE_{REMOTE,LOCAL}.
Reporter | ||
Comment 8•11 years ago
|
||
Er, I mean DEVTOOLS_DEBUGGER_DISPLAY_SOURCE_{REMOTE,LOCAL}_MS. It should end in _MS because we are measuring milliseconds and this is an existing convention.
Assignee | ||
Comment 9•11 years ago
|
||
Hi guys, I'm having an issue, ive defined the probe in the Histogrm.json file but it does not seem to find the histogramId when i want to add the probe in a file. Am i missing something.
Reporter | ||
Comment 10•11 years ago
|
||
Can you upload your patch and the error + stack trace? Hard to help without much info. Off the top of my head, you might need to do a full $ ./mach build after adding the telemetry probe. See if you still get the error after that.
Assignee | ||
Comment 11•11 years ago
|
||
ok. i thought of that. but i tried to build just the toolkit/components/telemetry folder but didn't work. Am running a full build now. will let you know. Thanks
Assignee | ||
Comment 12•11 years ago
|
||
it worked, it needed a full build. thanks.
Assignee | ||
Comment 13•11 years ago
|
||
Defined probes in Histogram.json, added probe the debugger-view.js Not sure how test for LOCAL and REMOTE connections to decide which probe to use
Attachment #804932 -
Flags: feedback?(nfitzgerald)
Reporter | ||
Comment 14•11 years ago
|
||
Comment on attachment 804932 [details] [diff] [review] Bug 907755 - added telemetry probes for how long it takes us to display the source text to the user Review of attachment 804932 [details] [diff] [review]: ----------------------------------------------------------------- |DebuggerClient| instances have a |localTransport| boolean property that is true when (drum roll please) the transport is local. let transportType = DebuggerController.client.localTransport ? "LOCAL" : "REMOTE"; ::: browser/devtools/debugger/debugger-view.js @@ +257,5 @@ > + let histogramId = "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE" + transportType + "_MS"; > + try { > + histogram = Services.telemetry.getHistogramById(histogramId); > + startTime = +new Date(); > + } catch(e){ Small style nit: please add a space between the closing paren and opening curly, like the rest of the file. I guess this actually doesn't matter since you will remove the try/catch before we land this, right? @@ +287,5 @@ > // Synchronize any other components with the currently displayed source. > DebuggerView.Sources.selectedValue = aSource.url; > DebuggerController.Breakpoints.updateEditorBreakpoints(); > > + // add probe Small nit: unnecessary comment. @@ +288,5 @@ > DebuggerView.Sources.selectedValue = aSource.url; > DebuggerController.Breakpoints.updateEditorBreakpoints(); > > + // add probe > + if(histogram){ Small style nit: please add spaces after "if" before the opening paren, and after the closing paren, before the opening curly.
Attachment #804932 -
Flags: feedback?(nfitzgerald) → feedback+
Assignee | ||
Comment 15•11 years ago
|
||
yeah, i'm taking out the try catch before we land. thanks for the feedback.
Assignee | ||
Comment 16•11 years ago
|
||
Changes based on feedback
Attachment #804932 -
Attachment is obsolete: true
Attachment #806973 -
Flags: review?(nfitzgerald)
Reporter | ||
Comment 17•11 years ago
|
||
Comment on attachment 806973 [details] [diff] [review] Added telemetry probes for how long it takes to display a selected source text to the user Review of attachment 806973 [details] [diff] [review]: ----------------------------------------------------------------- Doesn't apply on the latest fx-team for me, needs to be rebased. I will give review+ once you upload the updated patch and I can give the patch a spin for myself :) ::: browser/devtools/debugger/debugger-view.js @@ +248,5 @@ > * @param object aSource > * The source object coming from the active thread. > */ > set editorSource(aSource) { > + let histogram, startTime, transportType; Small style nit: don't pre-declare variables, just do it as you use them since you aren't assigning to them in a different block from the block they are declared in. Also, you are re-declaring transportType below anyways. @@ +286,5 @@ > // Synchronize any other components with the currently displayed source. > DebuggerView.Sources.selectedValue = aSource.url; > DebuggerController.Breakpoints.updateEditorBreakpoints(); > > + if (histogram) { Since we are always creating the histogram, we don't need this if check.
Attachment #806973 -
Flags: review?(nfitzgerald) → feedback+
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #806973 -
Attachment is obsolete: true
Attachment #807487 -
Flags: feedback?(nfitzgerald)
Reporter | ||
Comment 19•11 years ago
|
||
Comment on attachment 807487 [details] [diff] [review] Added telemetry probes for how long it takes to display a selected source text to the user Review of attachment 807487 [details] [diff] [review]: ----------------------------------------------------------------- Looks like a bad rebase, will look at it again when you figure all that stuff out. If you need help determining which bits of code came from where and what should be kept or not, feel free to ping me on IRC or send an email or whatever. ::: browser/devtools/debugger/debugger-view.js @@ +308,5 @@ > return; > } > + this.editor.setText(aText); > + this.editor.resetUndo(); > + this.setEditorMode(aSource.url, aSource.contentType, aText); What is this new code? Why is this here? @@ +314,5 @@ > this._setEditorText(aText); > this._setEditorMode(aSource.url, aSource.contentType, aText); > + // Update the editor's current caret and debug locations given by the > + // currently active frame in the stack, if there's one available. > + this.updateEditor(); Ditto. @@ +327,5 @@ > + > + histogram.add(+new Date() - startTime); > + > + // Notify that we've shown a source file. > + window.dispatchEvent(document, "Debugger:SourceShown", aSource); I think you have a bad rebase, I believe this was replaced with the window.emit above.
Attachment #807487 -
Flags: feedback?(nfitzgerald)
Assignee | ||
Comment 20•11 years ago
|
||
Thanks nick, i figured something was wrong with the rebase, but was not too sure. Am sorting it out. Rookie issues.
Assignee | ||
Comment 21•11 years ago
|
||
Fixed the issues.
Attachment #807487 -
Attachment is obsolete: true
Attachment #808145 -
Flags: review?(nfitzgerald)
Attachment #808145 -
Flags: feedback?(nfitzgerald)
Reporter | ||
Comment 22•11 years ago
|
||
Comment on attachment 808145 [details] [diff] [review] Added telemetry probes to measure how long it takes to display a selected source text to the user Review of attachment 808145 [details] [diff] [review]: ----------------------------------------------------------------- LGTM. Made a small edit to DebuggerClient#localTransport to match DebuggerClient.requester, because it was report remote transports on a local one, but this was a tiny edit. https://hg.mozilla.org/integration/fx-team/rev/6325295b03c9 Thanks for the patch :)
Attachment #808145 -
Flags: review?(nfitzgerald)
Attachment #808145 -
Flags: review+
Attachment #808145 -
Flags: feedback?(nfitzgerald)
Reporter | ||
Updated•11 years ago
|
Whiteboard: [mentor=nfitzgerald@mozilla.com][lang=js] → [good first bug][mentor=nfitzgerald@mozilla.com][lang=js][fixed-in-fx-team]
Comment 23•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6325295b03c9
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug][mentor=nfitzgerald@mozilla.com][lang=js][fixed-in-fx-team] → [good first bug][mentor=nfitzgerald@mozilla.com][lang=js]
Target Milestone: --- → Firefox 27
Comment 24•11 years ago
|
||
Comment on attachment 808145 [details] [diff] [review] Added telemetry probes to measure how long it takes to display a selected source text to the user Review of attachment 808145 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/debugger/debugger-view.js @@ +36,5 @@ > showOverviewRuler: true > }; > > +//For telemetry > +Cu.import("resource://gre/modules/Services.jsm") You don't need this here, it's imported in debugger-controller.js, which shares the same scope. @@ +287,5 @@ > return this._editorSource.promise; > } > + let transportType = DebuggerController.client.localTransport > + ? "_LOCAL" > + : "_REMOTE"; Could use gClient for nicer formatting. @@ +291,5 @@ > + : "_REMOTE"; > + //Telemetry probe > + let histogramId = "DEVTOOLS_DEBUGGER_DISPLAY_SOURCE" + transportType + "_MS"; > + let histogram = Services.telemetry.getHistogramById(histogramId); > + let startTime = +new Date(); Date.now() is more appropriate. @@ +313,5 @@ > DebuggerView.Sources.selectedValue = aSource.url; > DebuggerController.Breakpoints.updateEditorBreakpoints(); > > + histogram.add(+new Date() - startTime); > + Ditto.
Comment 25•11 years ago
|
||
Attachment #809908 -
Flags: review?(nfitzgerald)
Reporter | ||
Comment 26•11 years ago
|
||
Comment on attachment 809908 [details] [diff] [review] Few small followups Review of attachment 809908 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, Victor :)
Attachment #809908 -
Flags: review?(nfitzgerald) → review+
Comment 27•11 years ago
|
||
Try was green: https://tbpl.mozilla.org/?tree=Try&rev=88b14648c12c
Comment 28•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/1fd8a49e4c2a
Whiteboard: [good first bug][mentor=nfitzgerald@mozilla.com][lang=js] → [good first bug][mentor=nfitzgerald@mozilla.com][lang=js][fixed-in-fx-team]
Comment 29•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1fd8a49e4c2a
Whiteboard: [good first bug][mentor=nfitzgerald@mozilla.com][lang=js][fixed-in-fx-team] → [good first bug][mentor=nfitzgerald@mozilla.com][lang=js]
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•