Closed
Bug 859042
Opened 12 years ago
Closed 9 years ago
Create onload and DOMContentLoaded markers in the timeline
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect, P1)
DevTools
Performance Tools (Profiler/Timeline)
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Firefox 44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: vporof, Assigned: vporof)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [polish-backlog] [difficulty=medium])
Attachments
(3 files)
14.67 KB,
patch
|
jsantell
:
review+
smaug
:
review-
|
Details | Diff | Splinter Review |
13.14 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
13.62 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
Along with bug 859041.
Assignee | ||
Updated•12 years ago
|
Summary: [netmonitor] Show onload and DOMContentReady markers in the timeline → [netmonitor] Show onload and DOMContentLoaded markers in the timeline
Assignee | ||
Comment 1•12 years ago
|
||
Moving into Developer Tools: Netmonitor component. Filter on NETMONITORAMA.
Component: Developer Tools → Developer Tools: Netmonitor
Summary: [netmonitor] Show onload and DOMContentLoaded markers in the timeline → Show onload and DOMContentLoaded markers in the timeline
Assignee | ||
Updated•12 years ago
|
Priority: -- → P2
Updated•10 years ago
|
Whiteboard: [devedition-40]
Updated•9 years ago
|
Blocks: firebug-gaps
Updated•9 years ago
|
Whiteboard: [devedition-40] → [polish-backlog]
Comment 2•9 years ago
|
||
Re-adjusting priority - having these markers is critical for letting developers profile page load.
Priority: P2 → P1
Assignee | ||
Comment 3•9 years ago
|
||
I can do this if nobody else volunteers.
Comment 4•9 years ago
|
||
(In reply to Victor Porof [:vporof][:vp] from comment #3)
> I can do this if nobody else volunteers.
Excellent. As soon as this is fixed I can fix bug 1174091
Honza
Comment 5•9 years ago
|
||
Throwing this at you Victor since no one else checking it out -- I assumed this was for performance tools, but wonder if whatever we use for network here we could also use for perf?
Assignee: nobody → vporof
Blocks: de-44-polish
Assignee | ||
Updated•9 years ago
|
Whiteboard: [polish-backlog] → [polish-backlog] [difficulty=hard]
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8678116 -
Flags: review?(jsantell)
Attachment #8678116 -
Flags: review?(bugs)
Comment 7•9 years ago
|
||
Comment on attachment 8678116 [details] [diff] [review]
v1
> nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
> nsIChannel* aChannel, nsresult aStatus)
> {
> if (!aChannel) {
> return NS_ERROR_NULL_POINTER;
> }
>
> nsCOMPtr<nsIURI> url;
> nsresult rv = aChannel->GetURI(getter_AddRefs(url));
> if (NS_FAILED(rv)) {
> return rv;
> }
>
>+ RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
>+
>+ if (timelines && timelines->HasConsumer(this)) {
>+ timelines->AddMarkerForDocShell(
>+ this, "document::Load", MarkerTracingType::TIMESTAMP);
>+ }
Why is this here and not in the place where we actually dispatch load event?
I would move the code to nsDocumentViewer::LoadComplete, unless there is some strong reason to put it to docshell.
That would make it also clear whether the code runs in case we're coming from bfcache, since we check there if (!restoring) {
I wonder if we could add a static helper method to TimelineConsumers which
then calls Get() and AddMarkerForDocShell if needed.
Attachment #8678116 -
Flags: review?(bugs) → review-
Comment 8•9 years ago
|
||
Comment on attachment 8678116 [details] [diff] [review]
v1
Review of attachment 8678116 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with css variable name change and moving the marker test with the other marker tests, and match that structure (it's mostly boilerplate).
You should probably have someone else review the cpp changes
::: devtools/client/performance/modules/markers.js
@@ +93,5 @@
> },
> + "document::DOMContentLoaded": {
> + group: 1,
> + colorName: "graphs-doc-domcontentloaded",
> + label: "DOMContentLoaded"
I guess we don't need to L10N these.
::: devtools/client/performance/test/browser_timeline-waterfall-load-markers.js
@@ +1,5 @@
> +/* Any copyright is dedicated to the Public Domain.
> + http://creativecommons.org/publicdomain/zero/1.0/ */
> +
> +/**
> + * Tests if the sidebar is updated with "DOMContentLoaded" and "load" markers.
This test isn't testing timeline/waterfall/sidebar anything, it's testing just marker creation -- should go with other tests in `devtools/server/tests/browser/browser_markers*`
::: devtools/client/themes/variables.css
@@ +51,5 @@
> --theme-graphs-orange: #d97e00;
> --theme-graphs-red: #e57180;
> --theme-graphs-grey: #cccccc;
> + --theme-graphs-doc-domcontentloaded: #00f;
> + --theme-graphs-doc-load: #f00;
I think calling these `--theme-graphs-full-red` or something is more consistent, as the other styles don't have any semantic meanings (as they are rather arbitrary) -- also, just because chrome uses hard blue and hard red, doesn't mean we have to do the same for our markers, but maybe this doesn't matter if we move it to being a "line" anyway.
Attachment #8678116 -
Flags: review?(jsantell) → review+
Comment 9•9 years ago
|
||
Ah ok I didn't see you pinged smaug for the cpp changes :)
Assignee | ||
Comment 10•9 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #7)
> Comment on attachment 8678116 [details] [diff] [review]
> v1
>
> > nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
> > nsIChannel* aChannel, nsresult aStatus)
> > {
> > if (!aChannel) {
> > return NS_ERROR_NULL_POINTER;
> > }
> >
> > nsCOMPtr<nsIURI> url;
> > nsresult rv = aChannel->GetURI(getter_AddRefs(url));
> > if (NS_FAILED(rv)) {
> > return rv;
> > }
> >
> >+ RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
> >+
> >+ if (timelines && timelines->HasConsumer(this)) {
> >+ timelines->AddMarkerForDocShell(
> >+ this, "document::Load", MarkerTracingType::TIMESTAMP);
> >+ }
> Why is this here and not in the place where we actually dispatch load event?
> I would move the code to nsDocumentViewer::LoadComplete, unless there is
> some strong reason to put it to docshell.
>
> That would make it also clear whether the code runs in case we're coming
> from bfcache, since we check there if (!restoring) {
>
>
The only reason is that I didn't know where we actually dispatched the load event :) I browsed the code for a while and found something that looked like it does what I want it to do.
Indeed nsDocumentViewer::LoadComplete is a much better place.
>
> I wonder if we could add a static helper method to TimelineConsumers which
> then calls Get() and AddMarkerForDocShell if needed.
It does seem like it's a fairly frequently used method, but I'm not sure giving it "preferential treatment" is that much nicer.
Assignee | ||
Updated•9 years ago
|
Summary: Show onload and DOMContentLoaded markers in the timeline → Create onload and DOMContentLoaded markers in the timeline
Whiteboard: [polish-backlog] [difficulty=hard] → [polish-backlog] [difficulty=medium]
Assignee | ||
Comment 11•9 years ago
|
||
Broke down this bug into two parts. The netmonitor frontend bits are in bug 1218078, next on my list.
No longer blocks: 1218078
Comment 13•9 years ago
|
||
Comment on attachment 8678466 [details] [diff] [review]
v2
It is not clear to me what document::Load is about if we notify this way.
Do we want to notify also when we just dispatch pageshow and not load (when coming from bfcache)
There is the comment
"+A marker generated when the document's "load" event is fired."
which hints the patch isn't right
but the code in DocumentViewer should be moved to be somewhere before
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
And when moving the code there, no need to null check window.
And because SetReadyStateInternal may destroy worlds, add the code before that and then
you can also reuse the existing docShell variable.
With that, r+
Attachment #8678466 -
Flags: review?(bugs) → review+
Comment 16•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Updated•9 years ago
|
Keywords: dev-doc-needed
Comment 17•9 years ago
|
||
I've added these to the list of markers: https://developer.mozilla.org/en-US/docs/Tools/Performance/Waterfall#Markers
Do we need anything else here?
Flags: needinfo?(jsantell)
Updated•9 years ago
|
Component: Developer Tools: Netmonitor → Developer Tools: Performance Tools (Profiler/Timeline)
Updated•9 years ago
|
Keywords: dev-doc-needed → dev-doc-complete
Comment 19•9 years ago
|
||
(In reply to Will Bamberg [:wbamberg] from comment #17)
> I've added these to the list of markers:
> https://developer.mozilla.org/en-US/docs/Tools/Performance/Waterfall#Markers
Please note bug 1233325.
Also, testing with Nightly 2015-12-16 it sometimes happens that the two events are triggered at the same time according to the performance profile, which looks somewhat suspicious to me, and sometimes they are not recorded at all.
Though I assume both are bugs of the Performance panel. Can you reproduce this? Should I file separate bugs for those?
Sebastian
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•