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

[RUMF-447]: Only collect first-contentful-paint if page is visible #361

Merged
merged 30 commits into from
Apr 28, 2020

Conversation

glorieux
Copy link
Contributor

No description provided.

@glorieux glorieux requested a review from a team as a code owner April 15, 2020 07:19
@codecov-io
Copy link

codecov-io commented Apr 15, 2020

Codecov Report

Merging #361 into master will increase coverage by 0.31%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #361      +/-   ##
==========================================
+ Coverage   86.67%   86.98%   +0.31%     
==========================================
  Files          30       30              
  Lines        1703     1706       +3     
  Branches      345      346       +1     
==========================================
+ Hits         1476     1484       +8     
+ Misses        227      222       -5     
Impacted Files Coverage Δ
packages/rum/src/performanceCollection.ts 65.57% <100.00%> (+1.78%) ⬆️
packages/rum/src/rum.ts 90.32% <0.00%> (+5.37%) ⬆️

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 971bf12...b4aee4d. Read the comment docs.

packages/rum/test/viewTracker.spec.ts Outdated Show resolved Hide resolved
packages/rum/test/viewTracker.spec.ts Outdated Show resolved Hide resolved
packages/rum/test/viewTracker.spec.ts Outdated Show resolved Hide resolved
packages/rum/src/viewTracker.ts Outdated Show resolved Hide resolved
packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
Comment on lines 562 to 568
const session = {
getId: () => undefined,
isTracked: () => true,
isTrackedWithResource: () => true,
}
const FAKE_RESOURCE: Partial<PerformanceEntry> = { name: 'http://foo.com', entryType: 'resource' }
const performanceEntry = { entryType: 'view', name: 'first-contentful-paint' }
Copy link
Contributor

@bcaudan bcaudan Apr 27, 2020

Choose a reason for hiding this comment

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

it could be moved to the constant section at the beginning of the describe in order to not repeat it between the two tests

packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
glorieux and others added 2 commits April 28, 2020 08:16
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
packages/rum/test/rum.spec.ts Outdated Show resolved Hide resolved
Copy link
Member

@BenoitZugmeyer BenoitZugmeyer left a comment

Choose a reason for hiding this comment

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

That's great! Now that we are only testing the observed entry types, I think we can move the test into performanceCollection.spec.ts, and only initialize the performance collection, no need to startRum etc.

To go even further, we could have something like function getEntryTypesToObserve(): string[] in performanceCollection.ts and only test this function instead of the whole performance collection.

@glorieux glorieux merged commit 76f18d9 into master Apr 28, 2020
@glorieux glorieux deleted the glorieux/fcp-visible branch April 28, 2020 13:00
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.

4 participants