Add support for w3c Server-timing headers
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(relnote-firefox 71+, firefox71 fixed)
People
(Reporter: zac.spitzer, Assigned: mozilla-bugzilla)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete, Whiteboard: [webpagetest])
Attachments
(4 files)
28.38 KB,
patch
|
garret.rus
:
ui-review+
Honza
:
feedback+
|
Details | Diff | Splinter Review |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
12.32 KB,
image/png
|
Details | |
15.24 KB,
patch
|
Details | Diff | Splinter Review |
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Updated•7 years ago
|
Comment 15•7 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 16•6 years ago
•
|
||
Garret wasn't active on Bugzilla for a long time, so I clear the ni.
And for what it's worth, somebody on Discourse was wondering why this feature isn't available yet.
Sebastian
Comment 18•6 years ago
|
||
Perhaps good first bug for upcoming internship (Outreachy #18)
Honza
Comment 19•5 years ago
|
||
Any news?
It's still frustrating and actually, it's hard to implement it in the production due to lack of FF support.
«Not enough value to add this to the project» :(
Updated•5 years ago
|
Assignee | ||
Comment 21•5 years ago
|
||
Uses mock data to show the server timings in the Timings panel.
Comment 22•5 years ago
|
||
@Sorin: Thanks for working on this! Here is the promised info:
So, the missing piece is sending the data to the place where it's rendered. Note that DevTools are based on client-server architecture (or client/backend).
- The part that is getting the
serverTiming
data from HTTP channel is the backend (or DevTools server). - The part that is rendering the data is the clients (or front-end)
The communication between these two parts is done through RDP (remote debugging protocol)
We just send packets of JSON back and forward.
Details data about individual HTTP requests are fetched lazily on demand so, we keep the RDP traffic low.
The fetching usually happens when a side panel is opened e.g. in case of the Timings panel, it's here:
https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/devtools/client/netmonitor/src/components/TimingsPanel.js#36
So, there is already a packet type that is used to sending timing data.
I think that we can use it and extend it to convey the additional server timing data.
We were doing something similar when sending additional isRacing
field through security packet type
So, you need to study this patch:
https://github.com/mozilla/gecko-dev/commit/67808459acd383c95ea1c69c6cf69a55d719d0d0
Some more comments:
- Here is the method call where we add timings data
https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/devtools/server/actors/network-monitor/network-observer.js#418
and here is the impl:
https://searchfox.org/mozilla-central/source/devtools/server/actors/network-monitor/network-event.js#528
You need to extend it and add additional server timings data
- You also need to extend the packet type since it'll contain some new fields
See all the examples in the files to learn how it works.
- With little bit of luck you should get the data in the panel as part of the existing packet:
It should go through this place so, you might want to log something in case of issues:
https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/devtools/client/netmonitor/src/connector/firefox-data-provider.js#759
Honza
Comment 23•5 years ago
|
||
Btw. what test page should I use for testing?
Honza
Assignee | ||
Comment 24•5 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #23)
Btw. what test page should I use for testing?
Honza
Assignee | ||
Comment 25•5 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #22)
@Sorin: Thanks for working on this! Here is the promised info:
Thank you, they were just what I needed. Pushed another patch to use real data.
Updated•5 years ago
|
Comment 26•5 years ago
•
|
||
Harald, the patch here is almost ready. Do you have any comments on the UI?
A suggestion how the timings could be rendered in the Timings panel is attached.
Honza
Comment 27•5 years ago
|
||
Looks great, maybe we can use more subtle headers?
Inspector has these rules in the Grid panel:
.grid-container > span {
font-weight: 600;
margin-bottom: 5px;
pointer-events: none;
}
Comment 28•5 years ago
|
||
@ sorin: I am attaching a patch that solves the remaining backend issues:
- support for timings in headers as well as trailers
- using HTTPS for the test
- small CSS update
- adopting the test
Please look at my changes and merge with your patch on phab.
This is very close to landing.
Thanks for the help!
Honza
Assignee | ||
Comment 29•5 years ago
|
||
That looks great! Will probably only get the chance to merge it with my patch next Thursday/Friday though.
Comment 30•5 years ago
|
||
Comment 31•5 years ago
|
||
Comment 32•5 years ago
•
|
||
Backed out 2 changesets (bug 1403051) for causing devtools failures on browser_parsable_css.js CLOSED TREE
Backout revision https://hg.mozilla.org/integration/autoland/rev/e729376dff049ba4f17cf814203117f8a58e237c
Failure logs https://treeherder.mozilla.org/logviewer.html#?job_id=268560716&repo=autoland for dt 4
https://queue.taskcluster.net/v1/task/XR4Zk7nKT8eLKOmaHRqRsQ/runs/0/artifacts/public/logs/live_backing.log for dt3
Honza can you please take a look?
Assignee | ||
Comment 33•5 years ago
|
||
Fixed the tests and the formatting.
Comment 34•5 years ago
|
||
(In reply to Sorin Davidoi from comment #33)
Fixed the tests and the formatting.
Did you upload it on Phab?
The current version in Phab is still failing since the following CSS vars are not used:
.theme-light .network-monitor .requests-list-timings-box {
--timing-server-color1: rgba(104, 195, 179, 0.8); /* teal */
--timing-server-color2: rgba(123, 102, 167, 0.8); /* purple */
--timing-server-color3: rgba(233, 236, 130, 0.8); /* yellow */
--timing-server-color-total: rgba(186, 90, 140, 0.8); /* pink */
}
.theme-dark .network-monitor .requests-list-timings-box {
--timing-server-color1: rgba(74, 228, 201, 0.8); /* teal */
--timing-server-color2: rgba(156, 119, 233, 0.8); /* purple */
--timing-server-color3: rgba(234, 239, 73, 0.8); /* yellow */
--timing-server-color-total: rgba(186, 74, 133, 0.8); /* pink */
}
Assignee | ||
Comment 35•5 years ago
|
||
Did you upload it on Phab?
Yes.
The current version in Phab is still failing since the following CSS vars are not used
They are used, but maybe not in the right way?
backgroundColor: `var(--timing-server-color${color})`
Comment 36•5 years ago
|
||
Ah, I see that. Commented on Phab
Honza
Comment 37•5 years ago
|
||
Comment 38•5 years ago
|
||
bugherder |
Comment 39•5 years ago
|
||
This seems like a good candidate for a release note, no?
Comment 40•5 years ago
|
||
Yes, agree. It's already recorded in the MDN content roadmap: https://trello.com/c/dE8tJ7my/87-network-monitor-enhancements-fx-71
Honza
Comment 41•5 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Server-timings are used by companies to track performance and it has been a long-standing feature gap.
[Affects Firefox for Android]: No
[Suggested wording]: Using the new server-timing information in DevTools' Network panel, developers can analyze the server-related timings in context of other request and response details.
[Links (documentation, blog post, etc)]: https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_details#Timings
Comment 42•5 years ago
|
||
Yay! Glad to see this. Kinda feel bad I didn't do it myself though.
One question... does it only support trailing headers? Or is that a just under the hood detail?
Comment 43•5 years ago
|
||
I am trying to validate with a test case, but it should be a platform detail that isn't exposed to the frontend and should just work.
Comment 44•5 years ago
|
||
Harald, are you requesting an addition to our general release notes? The relnote-firefox flag is for our main release notes (such as https://www.mozilla.org/en-US/firefox/69.0/releasenotes/). If you only need added to our MDN notes for a release (https://developer.mozilla.org/fr/docs/Mozilla/Firefox/Versions/69) then the dev-doc-needed keyword is enough.
Comment 45•5 years ago
|
||
Thanks Pascal, I would like to give this a shot for the general release notes as it is interesting for an audience beyond frontend developers, like devops, QA and backend; and it is a long-standing tooling gap where Firefox is the last to ship the UI for inspecting the values. Given that, it should fit well into the Developer section.
(Aside, dev-doc-needed
does not necessarely ensure that work makes it into release notes atm, with missing triage.)
Comment 46•5 years ago
|
||
I added it in Nightly notes so as that we don't forget it for beta notes https://www.mozilla.org/en-US/firefox/71.0a1/releasenotes/
Comment 48•5 years ago
|
||
Hi there,
I'm trying to figure out what MDN documentation needs to be written for this, and I'm not sure. We have this section alread:
https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor/request_details#Timings
Does anything need to be aded to it? If so, what? I see the timings tab has some new parts to it; what bits relate to Server-Timing?
Thanks!
Updated•5 years ago
|
Comment 49•5 years ago
|
||
Luckily there is some prior art, like: https://ma.ttias.be/server-timings-chrome-devtools/ , https://www.smashingmagazine.com/2018/10/performance-server-timing/#the-server-timing-header and https://umaar.com/dev-tips/136-server-timing/
Comment 50•5 years ago
|
||
Thanks :digitarald! This is now documented; see https://github.com/mdn/sprints/issues/2277#issuecomment-561281970 for the full details.
Let me know if you think this needs anything else. Thanks!
Description
•