fix(web-vitals): use PerformanceEntry.startTime for web vitals log timestamps where possible#1420
Merged
Merged
Conversation
Contributor
Chrome DevTools Protocol Tracing (Script: 125.23ms, Heap: 12.62MB)
Lighthouse (Script Eval: 137.94ms)
Platform Tests (vite-7 es2015 gzip: 70.83KB)vite-6 Platform Tests
vite-7 Platform Tests
webpack-5 Platform Tests
|
joseph-embrace
force-pushed
the
jwynn/fix/web-vitals-log-timestamp
branch
2 times, most recently
from
July 9, 2026 03:09
c1755cd to
b076db3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1420 +/- ##
==========================================
- Coverage 96.87% 96.87% -0.01%
==========================================
Files 233 233
Lines 10183 10208 +25
Branches 1440 1447 +7
==========================================
+ Hits 9865 9889 +24
- Misses 316 317 +1
Partials 2 2
🚀 New features to boost your workflow:
|
joseph-embrace
enabled auto-merge (squash)
July 9, 2026 06:39
overbalance
reviewed
Jul 11, 2026
overbalance
reviewed
Jul 13, 2026
joseph-embrace
force-pushed
the
jwynn/fix/web-vitals-log-timestamp
branch
2 times, most recently
from
July 20, 2026 06:23
9f4e9e0 to
4ab9068
Compare
overbalance
approved these changes
Jul 20, 2026
joseph-embrace
force-pushed
the
jwynn/fix/web-vitals-log-timestamp
branch
from
July 20, 2026 06:54
4ab9068 to
70b477d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem is this solving?
We have an inconsistency with how the log timestamps are set:
metric.attribution.largestShiftTimemetric.attribution.interactionTimethis.perf.getNowMillis())Metrics can be emitted very long after they occur, so we are not capturing the correct timestamp for other metrics.
Short description of changes
I believe the log timestamp should be the time when the metric actually started. For INP this is still
interactionTime. For CLS it's the start of the first layout shift (which is also the start of the session window). For everything else it's thePerformanceEntry.startTimefor the most recent entry*.*in practice, most metrics only have one entry
How has this been tested?
Unit tests
Checklist