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.
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
core(largest-contentful-paint): add new metric #9706
core(largest-contentful-paint): add new metric #9706
Changes from 15 commits
ec75de3
183b080
03f8ab6
52a8d28
4e2e688
f1836a0
449c7c5
d821da7
9cc6b8c
211a90b
ee9f34e
24db2ed
308f0fe
33fecc9
2b87da0
c473bf5
26bb02a
b848a73
967d630
5b80688
9da66f9
49aa30a
a71ab04
7fd52f4
f351590
ff42528
5e158e0
c2c34e2
dbb1cde
59b34ae
4cce545
694ad7d
d74d208
af84dd4
b41c98f
328209d
3173aff
f713adc
1424c68
81fcec0
9a8c269
02843ab
697cf9b
2bb6b26
c80abb6
5fa41eb
ca65238
5fe7a48
7c35c8b
9df0ea6
917f73a
0c0dc97
6cc68e3
793bfc6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
needs at least a sanity-check control flow test (see e.g. audits/metrics/fmp-test)
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.
@connorjclark FYI this file is not necessary for HTTPArchive
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.
can use https://web.dev/largest-contentful-paint for the link for now
It seems like the description is updated but the string itself is not? We shouldn't i18n the string if it isn't intended to be localized yet
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.
@connorjclark FYI this file is not necessary for HTTPArchive
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.
so right now the impl is identical to FMP except we use the observed LCP for our moment of interest/cutoff? maybe a quick note of this in a fileoverview or for the methods here?
if LCP is as similar to FCP as FMP is this sounds great! if LCP is as different from FCP as I think it is then we'll probably need to get fancier. that'll all shake out in validation though :)
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.
@patrickhulce how much do you suspect this? :)
If it's really different, there's not much benefit to landing a placeholder implementation (which needs tests, etc) instead of just returning the observed metric (or whatever) for now to keep the PR simpler.
Validation will really be local and having a stand-in impl on master doesn't help us much anyways, right?
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.
I would very surprised if we're able to continue with this approach.
That sounds like a reasonable way forward to me, though I'm not sure how much simpler it really gets given how light this part is :)
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.
can we add a test for this case?
i'd like to base the test from a real trace.
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.
can we get a single comment above each
if
case space shuttle style? in my first read I missed that we were counting backwards and was very confused :)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.
+1 to test cases for these :)
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.
hmmmm luckily i just made a huge corpus of new traces.
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.
I ran it on a bunch of traces
(i also put a log at
if (e.name === 'largestContentfulPaint::Invalidate')
):and I never hit the log point.
In fact, only two of these collected traces have
largestContentfulPaint::Invalidate
.https---www-huffpost-com--mobile-unthrottled-4-trace.json
- it's not from the main frame, so we ignore it.https---www-reddit-com--mobile-wpt-2-trace.json
- after a short gap, it's followed by alargestContentfulPaint::Candidate
.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.
according to https://chromium-review.googlesource.com/c/chromium/src/+/1745433/19#message-435ee4e2ea3f8d117b90bbc4f00c4f4486928eba
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.
note that some basic test cases can also be constructed by e.g.
create-test-trace.js
(and then adding LCP events), or lack of LCP can be found with existing traces :) This should make testing at least some of this more lightweight.It's obviously still good to find a real trace as you're doing to make sure the tests match what happens in reality (especially with cases like invalidation)
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.
IMO a real trace test for this does not need to be blocking landing (create-test-trace.js is nice :)), though if we wanted to add a flag that indicates if we fell into the invalidate path so we can examine frequency in HTTPArchive it wouldn't be the worst idea :)
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.
would still love some of those space shuttle comments though :D