Skip to content

timeseries [5/6] RUM-13949 Wire timeseries collection into RUM session lifecycle - #3435

Merged
satween merged 2 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-rum-session-wiring
Jun 12, 2026
Merged

timeseries [5/6] RUM-13949 Wire timeseries collection into RUM session lifecycle#3435
satween merged 2 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-rum-session-wiring

Conversation

@satween

@satween satween commented May 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Connects the standalone pipeline and public configuration API to the existing RUM session lifecycle, completing the end-to-end data flow from configuration through to event emission.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@satween satween changed the title RUM-13949 Wire timeseries collection into RUM session lifecycle timeseries RUM-13949 Wire timeseries collection into RUM session lifecycle May 12, 2026
@codecov-commenter

codecov-commenter commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.40%. Comparing base (5ad5017) to head (af31b3d).

Files with missing lines Patch % Lines
...lin/com/datadog/android/rum/internal/RumFeature.kt 89.33% 7 Missing and 1 partial ⚠️
...ternal/timeseries/serializer/CpuEventSerializer.kt 20.00% 0 Missing and 4 partials ⚠️
...nal/timeseries/serializer/MemoryEventSerializer.kt 0.00% 0 Missing and 4 partials ⚠️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 50.00% 2 Missing ⚠️
.../android/rum/timeseries/TimeseriesConfiguration.kt 66.67% 2 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/timeseries    #3435      +/-   ##
======================================================
+ Coverage               72.39%   72.40%   +0.01%     
======================================================
  Files                     977      977              
  Lines                   35820    35895      +75     
  Branches                 5970     5983      +13     
======================================================
+ Hits                    25930    25987      +57     
- Misses                   8268     8278      +10     
- Partials                 1622     1630       +8     
Files with missing lines Coverage Δ
...rum/src/main/kotlin/com/datadog/android/rum/Rum.kt 86.25% <100.00%> (+0.17%) ⬆️
...kotlin/com/datadog/android/rum/RumConfiguration.kt 92.47% <100.00%> (+0.17%) ⬆️
...d/rum/internal/domain/scope/RumApplicationScope.kt 94.57% <100.00%> (-0.66%) ⬇️
...droid/rum/internal/domain/scope/RumSessionScope.kt 91.81% <100.00%> (ø)
...m/internal/timeseries/RumSessionScopeTimeseries.kt 93.75% <100.00%> (ø)
...nal/timeseries/RumSessionScopeTimeseriesFactory.kt 100.00% <100.00%> (ø)
.../android/rum/internal/monitor/DatadogRumMonitor.kt 85.92% <50.00%> (-0.63%) ⬇️
.../android/rum/timeseries/TimeseriesConfiguration.kt 90.91% <66.67%> (-9.09%) ⬇️
...ternal/timeseries/serializer/CpuEventSerializer.kt 86.54% <20.00%> (-9.54%) ⬇️
...nal/timeseries/serializer/MemoryEventSerializer.kt 87.72% <0.00%> (-5.14%) ⬇️
... and 1 more

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 1632f2f to cdcacee Compare May 13, 2026 13:43
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from f630b6d to 3b05b0c Compare May 13, 2026 13:43
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from cdcacee to 9c62b82 Compare May 13, 2026 14:44
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 3b05b0c to 9d01d39 Compare May 13, 2026 14:44
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 9c62b82 to 509d75e Compare May 14, 2026 19:40
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 9d01d39 to 8ea9614 Compare May 14, 2026 19:40
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 509d75e to db0263b Compare May 20, 2026 15:27
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 8ea9614 to 9a49aaa Compare May 20, 2026 15:27
@datadog-prod-us1-5

This comment has been minimized.

@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from db0263b to ec3a571 Compare May 21, 2026 19:25
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch 2 times, most recently from 0db4915 to 91bf158 Compare May 21, 2026 20:16
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from ec3a571 to 62b2166 Compare May 21, 2026 20:16
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 91bf158 to 7298723 Compare May 22, 2026 13:01
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch 2 times, most recently from 4ee1870 to 4c08c9b Compare May 22, 2026 14:52
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 7298723 to cd319d9 Compare May 22, 2026 14:52
@satween satween changed the title timeseries RUM-13949 Wire timeseries collection into RUM session lifecycle timeseries [5/6] RUM-13949 Wire timeseries collection into RUM session lifecycle May 25, 2026
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 4c08c9b to acebd04 Compare May 27, 2026 09:59
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from cd319d9 to ac48ae9 Compare May 27, 2026 09:59
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from cf947b6 to 527f8b5 Compare May 27, 2026 21:14
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from eb04d67 to 3bc2f67 Compare May 27, 2026 21:14
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 527f8b5 to d8bd478 Compare May 28, 2026 08:53
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 3bc2f67 to 8c1fee9 Compare May 28, 2026 08:53
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from d8bd478 to 3615ce2 Compare May 28, 2026 08:59
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 8c1fee9 to 27ffe71 Compare May 28, 2026 08:59
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch from 3615ce2 to b30c63a Compare May 28, 2026 09:12
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch 4 times, most recently from d4fea36 to e46fbe0 Compare May 29, 2026 16:39
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from e46fbe0 to 8e019ac Compare June 5, 2026 15:59
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-memory-session-factory branch 2 times, most recently from 3e7c2dc to d0b680c Compare June 8, 2026 16:01
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch 2 times, most recently from 89cae98 to 98ef2c6 Compare June 9, 2026 13:33
Base automatically changed from tvaleev/feature/RUM-13949/timeseries-memory-session-factory to feature/timeseries June 9, 2026 14:39
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from 98ef2c6 to 65d113c Compare June 9, 2026 15:09
satween added 2 commits June 11, 2026 16:58
Adds `enableTimeseries()`/`disableTimeseries()` builder methods on `RumConfiguration.Builder`. Wires the `Timeseries.Factory` through `RumFeature` → `DatadogRumMonitor` → `RumApplicationScope` → `RumSessionScope`, so that a new `RumSessionScopeTimeseries` collector is created and started for each sampled session and stopped on session end or SDK teardown. Also enables timeseries in the Kotlin sample app.

Connects the standalone pipeline and public configuration API to the existing RUM session lifecycle, completing the end-to-end data flow from configuration through to event emission.

Existing scope and monitor test scaffolding is updated to pass `timeseriesFactory = null` / a mock factory where required. The `RumFeature.onStop()` ordering test verifies the writer is still live when the final flush fires.
- Restore closing `}` for `createDataWriter` accidentally dropped when
  `createTimeseriesCollectingFactory` was inserted after it
- Add `@OptIn(ExperimentalRumApi::class)` to `createTimeseries` test
  helper to satisfy -Werror on the experimental API usage
- Rename `RumSessionScopeFactoryTest.kt` →
  `RumSessionScopeTimeseriesFactoryTest.kt` to match contained class
  (ktlint filename rule)

Ref: RUM-13949
@satween
satween force-pushed the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch from cde192e to af31b3d Compare June 11, 2026 16:41
@satween

satween commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@satween
satween marked this pull request as ready for review June 11, 2026 16:51
@satween
satween requested review from a team as code owners June 11, 2026 16:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af31b3d917

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread features/dd-sdk-android-rum/api/apiSurface
@satween
satween merged commit 597959c into feature/timeseries Jun 12, 2026
27 checks passed
@satween
satween deleted the tvaleev/feature/RUM-13949/timeseries-rum-session-wiring branch June 12, 2026 12:15
@satween

satween commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

all notes will be fixed in sepatate branch

),
dataWriter = dataWriter
),
if (totalRamBytes > 0L) {

@aleksandr-gringauz aleksandr-gringauz Jun 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tbh, I find it hard to believe that there will be a situation that the total available RAM will be 0.

Should we just simplify and forget about this edge case? What will break?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if by some reason totalRam return 0 - it would lead to ArithmeticException. Timeserices's RAM collector would be trying to collect some values, then would fail on percentage calculation so basically would do some useless job

}

private fun initializeFPSVitalMonitor(frequency: VitalsUpdateFrequency): FPSVitalListener? {
if (frequency == VitalsUpdateFrequency.NEVER) return null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you explain how is this change related to the topic of this PR? is FPSVitalListener used in time series somehow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FPSVitalListener is enabled when vital frequency != NEVER. In the old logic a vitalScheduler was created iff frequency != NEVER. But with timeseries we also using vitalScheduler so it should be created if frequency != NEVER or timeseriesConfiguration != null. So why this changes was made

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