Skip to content

timeseries [3/6] RUM-13949: Add CPU timeseries data-point reader and serializer#3433

Draft
satween wants to merge 5 commits into
tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructurefrom
tvaleev/feature/RUM-13949/timeseries-cpu-support
Draft

timeseries [3/6] RUM-13949: Add CPU timeseries data-point reader and serializer#3433
satween wants to merge 5 commits into
tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructurefrom
tvaleev/feature/RUM-13949/timeseries-cpu-support

Conversation

@satween
Copy link
Copy Markdown
Contributor

@satween satween commented May 12, 2026

What does this PR do?

Adds CpuDatapointReader, which reads CPU-usage metrics from the existing CpuVitalReader vital and wraps them as DataPoint values; and CpuEventSerializer, which converts a batch of CPU DataPoints into a RumTimeseriesCpuEvent JSON object ready for ingestion.

Motivation

Implements CPU metric collection as the first concrete timeseries type, exercising the pipeline infrastructure introduced in the previous commit.

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)

Copy link
Copy Markdown
Contributor Author

satween commented May 12, 2026

@satween satween changed the title RUM-13949 Add CPU timeseries data-point reader and serializer timeseries RUM-13949: Add CPU timeseries data-point reader and serializer May 12, 2026
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch from 4406481 to 3c4b02d Compare May 13, 2026 13:43
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from cacd357 to 1a6f200 Compare May 13, 2026 13:43
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

❌ Patch coverage is 95.05495% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure@1a11660). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...internal/timeseries/provider/CpuDatapointReader.kt 79.17% 0 Missing and 5 partials ⚠️
...ternal/timeseries/serializer/CpuEventSerializer.kt 95.92% 0 Missing and 2 partials ⚠️
...atadog/android/rum/internal/timeseries/Pipeline.kt 91.67% 0 Missing and 1 partial ⚠️
...m/internal/timeseries/RumSessionScopeTimeseries.kt 96.77% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                                       Coverage Diff                                       @@
##             tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure    #3433   +/-   ##
===============================================================================================
  Coverage                                                                ?   72.37%           
===============================================================================================
  Files                                                                   ?      974           
  Lines                                                                   ?    35743           
  Branches                                                                ?     5959           
===============================================================================================
  Hits                                                                    ?    25868           
  Misses                                                                  ?     8253           
  Partials                                                                ?     1622           
Files with missing lines Coverage Δ
.../datadog/android/rum/internal/RumSessionTypeExt.kt 100.00% <100.00%> (ø)
...droid/rum/internal/domain/scope/RumSessionScope.kt 91.81% <100.00%> (ø)
.../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%> (ø)
...atadog/android/rum/internal/timeseries/Pipeline.kt 93.75% <91.67%> (ø)
...m/internal/timeseries/RumSessionScopeTimeseries.kt 95.74% <96.77%> (ø)
...ternal/timeseries/serializer/CpuEventSerializer.kt 95.92% <95.92%> (ø)
...internal/timeseries/provider/CpuDatapointReader.kt 79.17% <79.17%> (ø)
🚀 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 force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch from 3c4b02d to 98b83f2 Compare May 13, 2026 14:44
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from 7bb00bc to f1063fa Compare May 14, 2026 19:40
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch 2 times, most recently from 118d5ec to 431b419 Compare May 20, 2026 15:27
@datadog-datadog-prod-us1

This comment has been minimized.

@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch 2 times, most recently from 2b03f75 to 5e8be62 Compare May 21, 2026 20:16
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from fa10624 to 5968d81 Compare May 22, 2026 13:01
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch from 5e8be62 to 558a3fa Compare May 22, 2026 13:01
@satween satween changed the title timeseries RUM-13949: Add CPU timeseries data-point reader and serializer timeseries [3/5] RUM-13949: Add CPU timeseries data-point reader and serializer May 25, 2026
@satween satween changed the title timeseries [3/5] RUM-13949: Add CPU timeseries data-point reader and serializer timeseries [3/6] RUM-13949: Add CPU timeseries data-point reader and serializer May 25, 2026
satween and others added 5 commits May 27, 2026 10:58
- 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.
### What does this PR do?

Adds `CpuDatapointReader`, which reads CPU-usage metrics from the existing `CpuVitalReader` vital and wraps them as `DataPoint` values; and `CpuEventSerializer`, which converts a batch of CPU `DataPoint`s into a `RumTimeseriesCpuEvent` JSON object ready for ingestion.

### Motivation

Implements CPU metric collection as the first concrete timeseries type, exercising the pipeline infrastructure introduced in the previous commit.

### Additional Notes

`CpuDatapointReader` normalises the raw MHz value to a 0–100 percent scale and clamps it with `coerceIn`. `CpuEventSerializer` maps `RumSessionType` to `RumTimeseriesCpuEvent.Session.Type` via the `toTimeseriesCpuSessionType()` extension. Both classes are fully covered by unit tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from 5968d81 to 49598a9 Compare May 27, 2026 09:59
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-cpu-support branch from 75b5891 to 67a21c9 Compare May 27, 2026 09:59
@satween satween force-pushed the tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure branch from 49598a9 to 76026c3 Compare May 27, 2026 10:03
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