Skip to content

timeseries [2/6] RUM-13949: Implement timeseries pipeline infrastructure#3432

Open
satween wants to merge 2 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure
Open

timeseries [2/6] RUM-13949: Implement timeseries pipeline infrastructure#3432
satween wants to merge 2 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure

Conversation

@satween
Copy link
Copy Markdown
Contributor

@satween satween commented May 12, 2026

What does this PR do?

What does this PR do?

Adds the foundational building blocks shared by all timeseries metric types: the Timeseries lifecycle interface, immutable DataPoint, the Buffer/DeltaCompression/Pipeline data-processing chain, the EventWriter flush boundary, JsonSerializer interface, DataPointsReader/VitalReaderWrapper for OS-metric abstraction, and RumSessionScopeTimeseries — the generic per-session scheduler that drives sampling, batching, and writing for any metric type.

image

Motivation

Establishes the shared infrastructure that CPU and memory collectors will extend, keeping primitive types and pipeline logic isolated so they can be reviewed without metric-specific details.

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)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

❌ Patch coverage is 92.90780% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.12%. Comparing base (7b836ae) to head (5968d81).

Files with missing lines Patch % Lines
...ndroid/rum/internal/timeseries/DeltaCompression.kt 0.00% 7 Missing ⚠️
...m/internal/timeseries/RumSessionScopeTimeseries.kt 95.74% 1 Missing and 1 partial ⚠️
...atadog/android/rum/internal/timeseries/Pipeline.kt 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/timeseries    #3432      +/-   ##
======================================================
+ Coverage               72.08%   72.12%   +0.04%     
======================================================
  Files                     961      969       +8     
  Lines                   35399    35515     +116     
  Branches                 5883     5905      +22     
======================================================
+ Hits                    25515    25613      +98     
- Misses                   8267     8282      +15     
- Partials                 1617     1620       +3     
Files with missing lines Coverage Δ
.../datadog/android/rum/internal/RumSessionTypeExt.kt 100.00% <100.00%> (+9.52%) ⬆️
...droid/rum/internal/domain/scope/RumSessionScope.kt 91.76% <100.00%> (+0.74%) ⬆️
.../datadog/android/rum/internal/timeseries/Buffer.kt 100.00% <100.00%> (ø)
...tadog/android/rum/internal/timeseries/DataPoint.kt 100.00% <100.00%> (ø)
...nal/timeseries/RumSessionScopeTimeseriesFactory.kt 100.00% <100.00%> (ø)
...m/internal/timeseries/provider/DataPointsReader.kt 100.00% <100.00%> (ø)
...internal/timeseries/provider/VitalReaderWrapper.kt 100.00% <100.00%> (ø)
...atadog/android/rum/internal/timeseries/Pipeline.kt 93.75% <93.75%> (ø)
...m/internal/timeseries/RumSessionScopeTimeseries.kt 95.74% <95.74%> (ø)
...ndroid/rum/internal/timeseries/DeltaCompression.kt 0.00% <0.00%> (ø)

... 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-pipeline-infrastructure branch from 1a6f200 to 7bb00bc Compare May 13, 2026 14:44
@satween satween marked this pull request as ready for review May 14, 2026 09:20
@satween satween requested review from a team as code owners May 14, 2026 09:20
Copy link
Copy Markdown

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

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: 7bb00bc938

ℹ️ 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".

Base automatically changed from tvaleev/feature/RUM-13949/timeseries-json-schemas-api-surface to feature/timeseries May 14, 2026 11:02
Introduces the core primitives for the timeseries data pipeline: `Timeseries` interface (with `@NoOpImplementation`), `DataPoint`, `Buffer`, `DeltaCompression`, `Pipeline`, `EventWriter`, `JsonSerializer` interface, `DataPointsReader` interface, `VitalReaderWrapper`, and the generic `RumSessionScopeTimeseries` per-session collector. Also adds detekt safe-call allowlist entries for the new APIs.

### What does this PR do?

Adds the foundational building blocks shared by all timeseries metric types: the `Timeseries` lifecycle interface, immutable `DataPoint`, the `Buffer`/`DeltaCompression`/`Pipeline` data-processing chain, the `EventWriter` flush boundary, `JsonSerializer` interface, `DataPointsReader`/`VitalReaderWrapper` for OS-metric abstraction, and `RumSessionScopeTimeseries` — the generic per-session scheduler that drives sampling, batching, and writing for any metric type.

### Motivation

Establishes the shared infrastructure that CPU and memory collectors will extend, keeping primitive types and pipeline logic isolated so they can be reviewed without metric-specific details.

### Additional Notes

Unit tests cover all primitives. `DataPointForgeryFactory` and the `Configurator` registration are included so subsequent commits can write tests against generated `DataPoint` values. `RumSessionTypeExt` session-type mappings are added here (used by both CPU and memory serializers in later commits).
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from 7bb00bc to f1063fa Compare May 14, 2026 19:40
Copy link
Copy Markdown
Contributor

@kikoveiga kikoveiga left a comment

Choose a reason for hiding this comment

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

Nice! Just left some small comments, worth to check what Codex said about some concurrency issues.

Comment thread detekt_custom_safe_calls.yml Outdated
Comment thread detekt_custom_safe_calls.yml Outdated
@datadog-prod-us1-3

This comment has been minimized.

- Switch `RumSessionScopeTimeseries` from owning a per-session executor to accepting a shared `ScheduledExecutorService` (no creation, no shutdown).
- Add `RumSessionScopeTimeseriesFactory` so reviewers can see how `RumSessionScopeTimeseries` is instantiated.
- Wire timeseries `start`/`stop` lifecycle into `RumSessionScope` (`startTimeseries`/`stopTimeseries` called from `renewSession`/`stopSession`).
- Remove 3 unused entries added to `detekt_custom_safe_calls.yml` in this branch.
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from fa10624 to 5968d81 Compare May 22, 2026 13:01
@satween
Copy link
Copy Markdown
Contributor Author

satween commented May 22, 2026

@codex review

Copy link
Copy Markdown

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

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: 5968d81b3b

ℹ️ 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".

) {
if (!isActive(generation)) return@scheduleSafe
try {
synchronized(pipeline, pipeline::execute)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Re-check stop state after taking the pipeline lock

If a scheduled tick passes the isActive(generation) check and then onSessionStop() runs before this lock is acquired, the stop path sets the state to STOPPED and flushes the same pipeline first; after that, this tick still executes pipeline.execute(), can append a new sample, and will not reschedule or flush it because the final isActive check is false. In that stop/race window the last sample is silently left in the buffer, so the runnable should re-check activity after acquiring the lock or the stop path should otherwise prevent post-flush execution.

Useful? React with 👍 / 👎.

@satween satween changed the title timeseries RUM-13949: Implement timeseries pipeline infrastructure timeseries [2/5] RUM-13949: Implement timeseries pipeline infrastructure May 25, 2026
@satween satween changed the title timeseries [2/5] RUM-13949: Implement timeseries pipeline infrastructure timeseries [2/6] RUM-13949: Implement timeseries pipeline infrastructure May 25, 2026
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.

6 participants