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

♻️ [RUM-6188] Use performanceObserver for first input and event entries #2995

Merged

Conversation

amortemousque
Copy link
Collaborator

@amortemousque amortemousque commented Sep 16, 2024

Motivation

Following the introduction of performanceObservable to move away from performanceCollection: PR
Let use performanceObservable for first input and event entries.

Changes

  • Remove long-task and event entries from performanceCollection
  • Isolate firstInputPolyfill.ts in its own file
  • Use perfomanceObservable in trackFirstInput
  • Use perfomanceObservable in trackInteractionToNextPaint

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque force-pushed the aymeric/aymeric/use-performance-observable-first-input branch from d0657ac to ccf94b7 Compare September 16, 2024 12:22
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 48.21429% with 29 lines in your changes missing coverage. Please review.

Project coverage is 93.36%. Comparing base (5e00489) to head (aee8c5b).

Files with missing lines Patch % Lines
...ackages/rum-core/src/browser/firstInputPolyfill.ts 0.00% 25 Missing ⚠️
...ages/rum-core/src/browser/performanceObservable.ts 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2995      +/-   ##
==========================================
- Coverage   93.38%   93.36%   -0.02%     
==========================================
  Files         275      276       +1     
  Lines        7639     7647       +8     
  Branches     1716     1716              
==========================================
+ Hits         7134     7140       +6     
- Misses        505      507       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cit-pr-commenter bot commented Sep 16, 2024

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 161.83 KiB 161.95 KiB 125 B +0.08%
Logs 56.03 KiB 56.03 KiB 0 B 0.00%
Rum Slim 110.40 KiB 110.52 KiB 125 B +0.11%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.002 0.002 -0.000
addaction 0.034 0.040 0.006
addtiming 0.001 0.001 -0.000
adderror 0.032 0.032 -0.000
startstopsessionreplayrecording 0.868 0.931 0.063
startview 1.006 0.972 -0.034
logmessage 0.019 0.021 0.002
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 9.39 KiB 7.96 KiB -1465 B
addaction 39.10 KiB 39.96 KiB 879 B
addtiming 7.31 KiB 6.46 KiB -864 B
adderror 44.63 KiB 45.20 KiB 592 B
startstopsessionreplayrecording 5.83 KiB 4.54 KiB -1323 B
startview 356.31 KiB 408.51 KiB 52.20 KiB
logmessage 40.29 KiB 40.76 KiB 478 B

🔗 RealWorld

@amortemousque amortemousque force-pushed the aymeric/aymeric/use-performance-observable-first-input branch from ccf94b7 to ce5e23c Compare September 19, 2024 10:10
@amortemousque amortemousque marked this pull request as ready for review September 19, 2024 10:18
@amortemousque amortemousque requested a review from a team as a code owner September 19, 2024 10:18
const firstInputDelay = elapsed(firstInputEntry.startTime, firstInputEntry.processingStart)
let firstInputTargetSelector
const performanceFirstInputSubscription = createPerformanceObservable(configuration, {
type: RumPerformanceEntryType.FIRST_INPUT,
Copy link
Member

Choose a reason for hiding this comment

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

NIT: you could remove the condition on entryType below

@amortemousque amortemousque merged commit 6993ec7 into main Sep 20, 2024
19 checks passed
@amortemousque amortemousque deleted the aymeric/aymeric/use-performance-observable-first-input branch September 20, 2024 08:06
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