Skip to content
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: add new CLS (all frames) to hidden metrics audit #12476

Merged
merged 2 commits into from
May 13, 2021
Merged

Conversation

brendankenny
Copy link
Member

first checkbox of #12350

It should still be easy to copy and paste out of the variants file into the real metric file when the time comes. Doing it now in the metrics audit so the tail end of the May HTTP Archive run can pick up some CLS AF data with the new CLS definition.

@brendankenny brendankenny requested a review from a team as a code owner May 13, 2021 18:10
@brendankenny brendankenny requested review from patrickhulce and removed request for a team May 13, 2021 18:10
@google-cla google-cla bot added the cla: yes label May 13, 2021
@brendankenny brendankenny mentioned this pull request May 13, 2021
7 tasks
Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impl LGTM

I have the open naming question mostly because I'm not sure where this PR fits in with the overall plan for new CLS. If it's a very temporary thing that will disappear by 8.0, then as-is WFM. If it's being engraved permanently in metrics.js today, then let's chat :)

* @return {number}
*/
static newCumulativeLayoutShift(layoutShiftEvents) {
const gapµs = 1_000_000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this was super neat to see, I've seen enough people mistakenly use µs thinking it's "fancy" millisecond or nanosecond to be minorly concerned about this (not to mention problematic with the fact that all of our camelcase millisecond Ms are actually indistinguishible from capital Mu Ms) 😆

how sad would it be to use?

Suggested change
const gapµs = 1_000_000;
const gapMicroseconds = 1_000_000;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how sad would it be to use?

not sad at all :)

(not to mention problematic with the fact that all of our camelcase millisecond Ms are actually indistinguishible from capital Mu Ms)

ah, see, there's the problem. You're still writing M when clearly you mean Μ :D

@@ -789,6 +789,7 @@ declare global {
layoutShiftMaxSessionGap1sLimit5s: number,
layoutShiftMaxSliding1s: number,
layoutShiftMaxSliding300ms: number,
newCumulativeLayoutShiftAllFrames: number,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't expect new to be part of the internal name :)

layoutShiftMaxSessionGap1sLimit5sAllFrames? :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layoutShiftMaxSessionGap1sLimit5sAllFrames is good

@brendankenny
Copy link
Member Author

I have the open naming question mostly because I'm not sure where this PR fits in with the overall plan for new CLS. If it's a very temporary thing that will disappear by 8.0, then as-is WFM. If it's being engraved permanently in metrics.js today, then let's chat :)

ha, no, that's very much what I was planning, but I guess I didn't discuss with others more than here and in #12046. Basically live in metrics.js for collection today, but I was thinking layout-shift-variants (and its additions to metrics.js) wouldn't survive to 8.0, taking what works in it and in layout-shift-variants-test and moving it to the CLS, then deleting the rest.

@patrickhulce
Copy link
Collaborator

I was thinking layout-shift-variants (and its additions to metrics.js) wouldn't survive to 8.0, taking what works in it and in layout-shift-variants-test and moving it to the CLS, then deleting the rest.

Cool beans, that's what I figured, but wanted to double check just in case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants