-
Notifications
You must be signed in to change notification settings - Fork 134
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-780] implement track first hidden #621
Conversation
packages/rum/src/domain/rumEventsCollection/view/trackTimings.ts
Outdated
Show resolved
Hide resolved
According to review: * restore prod behavior for passive events listeners * support custom emitter, allowing to add listeners on `document` (for `visibilitychange` event) and any mocked object or element (for unit test) * add documentation * rename the function since it's not 'global' anymore
Codecov Report
@@ Coverage Diff @@
## master #621 +/- ##
==========================================
- Coverage 88.89% 88.23% -0.66%
==========================================
Files 54 56 +2
Lines 2503 2525 +22
Branches 541 546 +5
==========================================
+ Hits 2225 2228 +3
- Misses 278 297 +19
Continue to review full report at Codecov.
|
packages/rum/src/domain/rumEventsCollection/view/trackFirstHidden.spec.ts
Outdated
Show resolved
Hide resolved
packages/rum/src/domain/rumEventsCollection/view/trackFirstHidden.spec.ts
Show resolved
Hide resolved
packages/rum/src/domain/rumEventsCollection/view/trackFirstHidden.spec.ts
Outdated
Show resolved
Hide resolved
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.
👍
Motivation
Currently, we are tracking particular performance entries only if the page is not hidden when initializing the SDK (see #361 ). The issue with this strategy is: if the page is visible when initializing RUM, but it gets hidden before the
first-contentful-paint
is produced, the metric will be incorrect.We want to replace this strategy with something similar to
web-vitals
. It'll provide stronger guarantees that the page was not hidden prior to the observed performance entry.Changes
trackFirstHidden
trackFirstHidden
when collecting FCPTesting
I have gone over the contributing documentation.