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

✨ Discard long FCP and LCP #1045

Merged
merged 3 commits into from
Sep 15, 2021
Merged

Conversation

amortemousque
Copy link
Contributor

@amortemousque amortemousque commented Sep 13, 2021

Motivation

LCP and FCP reported after 10 minutes are meaningless therefore we discard them

Changes

Discard LCP and FCP reported after 10 min

Testing

Unit, Locally


I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner September 13, 2021 13:58
@amortemousque amortemousque force-pushed the aymeric/discard-long-FCP-and-LCP branch from bd90dc2 to dd79696 Compare September 13, 2021 13:59
@amortemousque amortemousque force-pushed the aymeric/discard-long-FCP-and-LCP branch from dd79696 to f9ef3d1 Compare September 13, 2021 13:59
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2021

Codecov Report

Merging #1045 (3083272) into main (7b7baf9) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1045   +/-   ##
=======================================
  Coverage   89.01%   89.02%           
=======================================
  Files          87       87           
  Lines        4134     4135    +1     
  Branches      950      952    +2     
=======================================
+ Hits         3680     3681    +1     
  Misses        454      454           
Impacted Files Coverage Δ
...umEventsCollection/view/trackInitialViewTimings.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b7baf9...3083272. Read the comment docs.

@@ -136,6 +136,16 @@ describe('trackFirstContentfulPaint', () => {
lifeCycle.notify(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, FAKE_PAINT_ENTRY)
expect(fcpCallback).not.toHaveBeenCalled()
})

it('should not be present if it happens after 10 minutes', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why?
it could be more interesting to indicate what we are trying to achieve, meaning discarding timings reported after a long time.

@@ -76,7 +77,8 @@ export function trackFirstContentfulPaint(lifeCycle: LifeCycle, callback: (fcp:
if (
entry.entryType === 'paint' &&
entry.name === 'first-contentful-paint' &&
entry.startTime < firstHidden.timeStamp
entry.startTime < firstHidden.timeStamp &&
entry.startTime < 10 * ONE_MINUTE
Copy link
Contributor

Choose a reason for hiding this comment

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

we should extract this constant, explain its purpose and how it was chosen

@amortemousque amortemousque merged commit 1c7d5e9 into main Sep 15, 2021
@amortemousque amortemousque deleted the aymeric/discard-long-FCP-and-LCP branch September 15, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants