Skip to content

timeseries RUM-13949: Add CPU timeseries data-point reader and serializer#3433

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

timeseries RUM-13949: Add CPU timeseries data-point reader and serializer#3433
satween wants to merge 4 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 90.41096% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.11%. Comparing base (5968d81) to head (75b5891).

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 ⚠️
Additional details and impacted files
@@                                       Coverage Diff                                        @@
##           tvaleev/feature/RUM-13949/timeseries-pipeline-infrastructure    #3433      +/-   ##
================================================================================================
- Coverage                                                         72.12%   72.11%   -0.00%     
================================================================================================
  Files                                                               969      971       +2     
  Lines                                                             35515    35588      +73     
  Branches                                                           5905     5920      +15     
================================================================================================
+ Hits                                                              25613    25664      +51     
- Misses                                                             8282     8286       +4     
- Partials                                                           1620     1638      +18     
Files with missing lines Coverage Δ
...ternal/timeseries/serializer/CpuEventSerializer.kt 95.92% <95.92%> (ø)
...internal/timeseries/provider/CpuDatapointReader.kt 79.17% <79.17%> (ø)

... and 40 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 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 and others added 2 commits May 22, 2026 13:59
### 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>
@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 and others added 2 commits May 22, 2026 14:50
…ions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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