DataDog / browser-sdk

Datadog Browser SDK
Apache License 2.0
279 stars 130 forks source link

♻️ [RUM-958] Use a performance observable instead of the lifecycle #2818

Open amortemousque opened 2 weeks ago

amortemousque commented 2 weeks ago

Motivation

The performanceCollection has too many concerns and limitations:

The goal of this PR is to be able to use separate performance observer for each entry type:

Changes

Testing


I have gone over the contributing documentation.

cit-pr-commenter[bot] commented 2 weeks ago

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 160.25 KiB 160.86 KiB 626 B +0.38%
Logs 57.91 KiB 57.91 KiB 4 B +0.01%
Rum Slim 108.77 KiB 109.39 KiB 626 B +0.56%
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.001 | 0.002 | 0.001 | | addaction | 0.030 | 0.043 | 0.013 | | adderror | 0.032 | 0.044 | 0.013 | | addtiming | 0.001 | 0.001 | 0.000 | | startview | 0.893 | 1.020 | 0.127 | | startstopsessionreplayrecording | 0.771 | 0.974 | 0.203 | | logmessage | 0.020 | 0.026 | 0.006 |
🧠 Memory Performance | Action Name | Base Consumption Memory (bytes) | Local Consumption Memory (bytes) | 𝚫 (bytes) | | --- | --- | --- | --- | | addglobalcontext | 22.20 KiB | 20.92 KiB | -1308 B | | addaction | 71.94 KiB | 71.11 KiB | -849 B | | adderror | 88.93 KiB | 86.31 KiB | -2681 B | | addtiming | 21.90 KiB | 19.44 KiB | -2520 B | | startview | 314.64 KiB | 334.02 KiB | 19.38 KiB | | startstopsessionreplayrecording | 13.51 KiB | 15.01 KiB | 1.50 KiB | | logmessage | 72.84 KiB | 70.91 KiB | -1979 B |

🔗 RealWorld

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 94.35484% with 7 lines in your changes missing coverage. Please review.

Project coverage is 93.64%. Comparing base (c48a9bd) to head (96c47cc).

Files Patch % Lines
...s/rum-core/test/emulate/mockPerformanceObserver.ts 87.87% 4 Missing :warning:
...ages/rum-core/src/browser/performanceObservable.ts 95.55% 2 Missing :warning:
...ages/rum-core/src/browser/performanceCollection.ts 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2818 +/- ## ========================================== + Coverage 93.31% 93.64% +0.32% ========================================== Files 263 266 +3 Lines 7482 7548 +66 Branches 1669 1679 +10 ========================================== + Hits 6982 7068 +86 + Misses 500 480 -20 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

amortemousque commented 4 days ago

/to-staging

dd-devflow[bot] commented 4 days ago

:steam_locomotive: Branch Integration: starting soon, median merge time is 0s

Commit 96c47cc4f5 will soon be integrated into staging-27.

Use /to-staging -c to cancel this operation!

dd-devflow[bot] commented 4 days ago

:steam_locomotive: Branch Integration: This commit was successfully integrated

Commit 96c47cc4f5 has been merged into staging-27 in merge commit ae24d645c0.