-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Performance guide for Server Timing #25575
Conversation
Preview URLs
External URLs (1)URL:
(comment last updated: 2023-05-17 10:25:53) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of grammar suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linting
Co-authored-by: dawei-wang <[email protected]>
Co-authored-by: dawei-wang <[email protected]>
c36ae6c
to
65aa842
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generally great. One optional comment.
It is would be good if https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing described the syntax of this header in a helpful way.
I mean it could say something like:
This header contains one or more metrics, separated by commas. Each metric has a name, an optional duration, and an optional description. These components are separated by semi-colons.
The duration component consists of the string
"dur"
, followed by"="
, followed by the value, like"dur=23.2"
.The description component consists of the string
"desc"
, followed by"="
, followed by the value, like"desc=DB lookup"
.
(say, between the current para 1 and para 2)
Somewhere it might be worth spelling out that these components map to PerformanceServerTiming
values like:
- "name" ->
PerformanceServerTiming.name
- "dur" ->
PerformanceServerTiming.duration
- "desc" ->
PerformanceServerTiming.description
// Logs "cache (Cache Read) duration: 23.2" | ||
// Logs "db () duration: 53" | ||
// Logs "app () duration: 47.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful for this to refer to a particular value for the header. I mean like:
Given a Server-Timing header with the following value:
"Server-Timing": "cache;desc="Cache Read";dur=23.2,db;dur=53,app;dur=47.2
...this code will log:
cache (Cache Read) duration: 23.2
db () duration: 53
app () duration: 47.2
(or something like that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this guide, @Elchi3!
I've added a few edit suggestions
(for some reason, the preview links are not working)
Co-authored-by: Dipika Bhattacharya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the updates!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thank you @Elchi3 !
* origin/pwa-main-page: (86 commits) Add Prettier to lint command (mdn#20674) Remove SVG <discard> docs (mdn#26856) Remove docs for <applet> (mdn#26850) refactor: migrate media.prod.mdn.mozit.cloud URLs (mdn#26809) chore: Remove embedlivesample macro calls with a fourth parameter (mdn#26816) Bump @mdn/yari from 2.21.0 to 2.22.0 (mdn#26858) WebTransport API (mdn#26529) Fix issue 26739: correct beforeunload situation wrt bfcache (mdn#26819) add missing colon (mdn#26846) Replace reference to time domain with amplitude domain in `AnalyserNode .fftSize` (mdn#26840) Fix issue 26048: document security requirements for opening and focus… (mdn#26838) Change all CSS spec URLs back to drafts.csswg.org (mdn#26833) Synchronize with BCD v5.2.58 (mdn#26829) Rename nonexistent globalScope to globalThis in service worker event examples (mdn#26808) Small typo fix (mdn#26822) removing scrollbar (mdn#26813) Fix typo (mdn#26826) docs(:not()): Update the syntax and example titles (mdn#26814) Add a Performance guide for Server Timing (mdn#25575) Fix a summary (mdn#26815) ...
Description
Adds a guide page for Server Timing.
Ideally, #25508 lands first because then I can:
(If it doesn't land first then I will update #25508 to include this page.)
Motivation
Part of openwebdocs/project#62
Additional details
None.