-
Notifications
You must be signed in to change notification settings - Fork 414
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
Measure relative to fetchStart? #19
Comments
The My recommendation would be to track TTFB (as defined here), but then also track additional metrics that you might have more control over fixing. |
Thanks, it's helpful to see there's some precedent to adjust these measurements relative to different points in the navigation timing. I'd want to shift values for all metrics that are measured from navigation start time (LCP, TTFB, FCP) so without support for offsets in the library I think the cleanest way would be to get the navigation timing data manually for use in the report handlers. (Using the nav timings from TTFB in other metrics seems error prone because of potential race conditions) Edit: unless you think this pattern is viable? not sure if some of these metrics would get missed by waiting for TTFB to fire first. getTTFB(metric => {
const timingOffset = metric.entries[0].fetchStart;
getFCP(fcp => {
log(fcp.value - timingOffset);
});
getLCP(...)
...
}); |
Ciao @deasems |
@Zizzamia My understanding is that paint timings intentionally do include the the redirect time (just like the navigation timings do) because their 'time origin' is the navigation startTime |
Yes, the web APIs all measure relative to the time origin, which includes unload, DNS, connection, etc.
That would work, though I'd strongly encourage you to at minimum track both versions of the metric, or track them separately so you could do the math on the back end but still report both values. I'd also encourage you to call the metrics by a different name of you're going to change their definition. Otherwise it could lead to confusion if you were going to compare those scores to the scores reported by other Google tools (and keep in mind that within Chrome, these values are always measured relative to the time origin). |
I'm going to close this issue as I don't think there's any additional changes that need to be made in the library or docs. Please let me know if I've missed something though, and I can reopen. |
Thanks for the guidance @philipwalton |
My application is behind authentication which is handled via redirects to another domain outside my control. I've implemented logging of navigation and paint timing metrics recently and noticed the redirect time introduces significant variance in the data (depending on if a redirect for auth was needed or not).
Looking at the Navigation timing model, it also seems inappropriate to include unload time from the previous site because that is out of my app's control.
Based on this I adjusted our perf measurements to be relative to the
fetchStart
instead ofstartTime
.I wanted to get your team's input - does this seem like a reasonable thing to do for performance metrics? or am I missing some value here?
Maybe this could be added as an option to this lib.
The text was updated successfully, but these errors were encountered: