Skip to content

♻️ move long task contexts to profiler#4046

Draft
BenoitZugmeyer wants to merge 2 commits intomainfrom
benoit/move-long-task-context
Draft

♻️ move long task contexts to profiler#4046
BenoitZugmeyer wants to merge 2 commits intomainfrom
benoit/move-long-task-context

Conversation

@BenoitZugmeyer
Copy link
Member

Also make it simpler, as we only care about ids

Motivation

Changes

Test instructions

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Dec 18, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 169.43 KiB 169.90 KiB +477 B +0.27%
Rum Profiler 4.29 KiB 4.64 KiB +354 B +8.05%
Rum Recorder 24.54 KiB 24.56 KiB +17 B +0.07%
Logs 56.72 KiB 56.72 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 126.26 KiB 125.96 KiB -305 B -0.24%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0045 0.0048 +6.67%
RUM - add action 0.0142 0.0151 +6.34%
RUM - add error 0.0133 0.014 +5.26%
RUM - add timing 0.0028 0.0034 +21.43%
RUM - start view 0.0134 0.0158 +17.91%
RUM - start/stop session replay recording 0.0007 0.0008 +14.29%
Logs - log message 0.0155 0.0153 -1.29%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 27.68 KiB 27.42 KiB -267 B
RUM - add action 51.86 KiB 51.05 KiB -829 B
RUM - add timing 26.47 KiB 26.97 KiB +505 B
RUM - add error 57.53 KiB 56.33 KiB -1.20 KiB
RUM - start/stop session replay recording 25.70 KiB 25.92 KiB +225 B
RUM - start view 453.18 KiB 450.06 KiB -3.12 KiB
Logs - log message 47.21 KiB 45.87 KiB -1.34 KiB

🔗 RealWorld

@datadog-official
Copy link

datadog-official bot commented Dec 18, 2025

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 1 Test failed

longTaskHistory createLongTaskHistory should add long task IDs to history when RAW_RUM_EVENT_COLLECTED is triggered with long_task event from Chrome 63.0.3239.84 (Windows 10) (Datadog) (Fix with Cursor)
Error: Expected $[0].startClocks.timeStamp = 1770920643014 to equal 1770920643015.
    at <Jasmine>
    at UserContext.it (webpack:///packages/rum/src/domain/profiling/longTaskHistory.spec.ts:37:70 <- /tmp/_karma_webpack_884282/commons.js:91468:44)
    at <Jasmine>

ℹ️ Info

❄️ No new flaky tests detected

🎯 Code Coverage
Patch Coverage: 91.67%
Overall Coverage: 77.26% (-0.02%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7cadb7d | Docs | Datadog PR Page | Was this helpful? Give us feedback!


lifeCycle.subscribe(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent, startTime, duration }) => {
if (rawRumEvent.type === 'long_task') {
history.add(rawRumEvent.long_task.id, startTime).close(addDuration(startTime, duration!))
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔨 warning: ‏We also send startClock, duration and entryType in the Profiling track.

@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/move-long-task-context branch from 794e9b1 to cd45062 Compare December 19, 2025 16:35
Base automatically changed from aymeric/fix-long-task-association to main January 5, 2026 11:34
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/move-long-task-context branch from cd45062 to 151e348 Compare January 12, 2026 16:34
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/move-long-task-context branch 2 times, most recently from 18403ee to 4922f44 Compare January 20, 2026 13:33
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/move-long-task-context branch from 4922f44 to 7cadb7d Compare February 12, 2026 17:47
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.

2 participants