Comments (7)
Yes, the web APIs all measure relative to the time origin, which includes unload, DNS, connection, etc.
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(...) ... });
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).
from web-vitals.
Thanks for the guidance @philipwalton
from web-vitals.
The getTTFB()
documentation addresses this issue and shows an example of how to measure things related to navigation timing—in addition to TTFB. Does that address your concern?
My recommendation would be to track TTFB (as defined here), but then also track additional metrics that you might have more control over fixing.
from web-vitals.
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(...)
...
});
from web-vitals.
Ciao @deasems
do the redirects in your app also influence FCP and LCP?
I ask because if it is, this would be something interesting to report also with the W3C Performance Timeline Committee
from web-vitals.
@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
from web-vitals.
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.
from web-vitals.
Related Issues (20)
- Firefox LCP tests failing
- Bug: LCP attribution can include `resourceLoadDelay` attribution timings far greater than the LCP value in cases where `onTTFB` discards the navigation data HOT 1
- FCP and TTFB are triggered multiple times HOT 7
- contributing LoAF basesd code that idenifies LoAF, INF and JS long tasks data HOT 1
- Capturing metadata with events HOT 2
- Allow to reset the INP calculation HOT 2
- v4 giving undefined TypeError HOT 1
- INP: Probably a bad measurement metric for web vitals - even with simple HTML structure pages with no CSS will cause bad value. HOT 1
- Expose INP target element as first class citizen in attribution HOT 3
- Expose ability to reset internal state of metrics (specifically INP) HOT 2
- v4 INP attribution ending processingEnd time in the wrong animation frame HOT 8
- CDN JS - Web server is returning an unknown error HOT 4
- CLS and INP are being calculated incorrectly HOT 2
- Suggestion to track all attributions HOT 4
- CLS being reported due to filter CSS transition HOT 3
- Firefox e2e tests flakey HOT 3
- can't find ReportCallback or ReportHandler type HOT 3
- Are there any updates for soft-navs? HOT 2
- LoAF missed for some INP events HOT 9
- Facing issue while exporting `web-vitals/attribution` using `browserify` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-vitals.