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-6565] Capture previous and current rects in CLS attribution data #3269

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

sethfowler-datadog
Copy link
Contributor

Motivation

When trying to understand the causes and impact of a Cumulative Layout Shift score, it's often helpful to see how the affected element's position and size has changed.

Changes

This PR adds the capability to capture the previous and current rects associated with layout shifts on supported browsers. The changes build on the standard LayoutShiftAttribution API and the recent changes in rum-events-format which gave us a place to store this data.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@sethfowler-datadog sethfowler-datadog requested a review from a team as a code owner January 8, 2025 18:05
@@ -433,6 +433,7 @@ export type TelemetryCommonFeaturesUsage =
| AddError
| SetGlobalContext
| SetUser
| SetAccount
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The account-related changes here got pulled in by yarn rum-events-format:sync. They're unrelated to the PR, but unfortunately it's hard to avoid pulling them in because of the order in which things got merged into rum-events-format. They'll disappear from the diff if Nicolas merges the PR that motivated them before this one lands, though, so the issue is temporary.

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.66%. Comparing base (85baa2b) to head (91ea40a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3269      +/-   ##
==========================================
- Coverage   93.67%   93.66%   -0.01%     
==========================================
  Files         288      288              
  Lines        7607     7613       +6     
  Branches     1735     1739       +4     
==========================================
+ Hits         7126     7131       +5     
- Misses        481      482       +1     

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

@sethfowler-datadog sethfowler-datadog force-pushed the seth.fowler/new-web-vitals-attribution-fields branch from 9102f3f to 6999e09 Compare January 10, 2025 15:30
Base automatically changed from seth.fowler/new-web-vitals-attribution-fields to main January 14, 2025 16:55
Copy link

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 145.14 KiB 145.51 KiB 378 B +0.25%
Logs 51.09 KiB 51.09 KiB 0 B 0.00%
Rum Slim 103.94 KiB 104.30 KiB 378 B +0.36%
Worker 24.50 KiB 24.50 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.001
addaction 0.040 0.062 0.022
addtiming 0.001 0.002 0.000
adderror 0.045 0.069 0.024
startstopsessionreplayrecording 0.008 0.014 0.006
startview 0.395 0.450 0.055
logmessage 0.028 0.032 0.004
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 27.77 KiB 29.79 KiB 2.03 KiB
addaction 55.14 KiB 58.69 KiB 3.55 KiB
addtiming 26.47 KiB 25.86 KiB -631 B
adderror 61.06 KiB 60.10 KiB -978 B
startstopsessionreplayrecording 28.53 KiB 25.42 KiB -3186 B
startview 415.29 KiB 418.25 KiB 2.97 KiB
logmessage 57.03 KiB 58.28 KiB 1.25 KiB

🔗 RealWorld

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