RUM-17613 Add integration tests for timeseries collection - #3713
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
|
Instrumented run status:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## tvaleev/feature/RUM-17613-2-timeseries-schema #3713 +/- ##
================================================================================
Coverage ? 73.38%
================================================================================
Files ? 1012
Lines ? 37094
Branches ? 6390
================================================================================
Hits ? 27221
Misses ? 8043
Partials ? 1830 🚀 New features to boost your workflow:
|
Rename the internal Timeseries interface to TimeseriesCollector and rename its implementations to DefaultTimeseriesCollector and DefaultTimeseriesCollectorFactory, propagating the new names through RumFeature, the RUM scope tree and the tests. No behaviour change. Ref: RUM-17613
53d8975 to
0c453b4
Compare
c932d24 to
e6e92e4
Compare
Replace the collector's four-state enum with a generation-counted state and schedule a 200 ms deferred suspension when the app leaves the foreground, so the buffered batch is written instead of dropped. Sampling only runs on a foreground view, which makes the collectInBackground switch obsolete. Ref: RUM-17613
Derive the CPU and memory timeseries schemas from _common-schema.json and replace the hand-written JSON serializers with typed event factories that populate the full common event shape (os, device, connectivity, dd, ddtags). Restrict collection through TimeseriesConfiguration.collectOnly. Ref: RUM-17613
Add a playground activity and an instrumented test that assert CPU and memory timeseries are collected, flushed on backgrounding and resumed on return to foreground. Ref: RUM-17613
0c453b4 to
43297b9
Compare
e6e92e4 to
1c35566
Compare
1c35566 to
a2fbff9
Compare
|
Superseded: branch renamed to |

What does this PR do?
Adds
TimeseriesTrackingPlaygroundActivityand an instrumentedTimeseriesCollectionTestthatrun the real collection pipeline against the mock RUM server: CPU and memory batches are emitted
with the expected sample counts, leaving the foreground flushes the pending batch, nothing is
collected while backgrounded, and collection resumes on return to the foreground.
Motivation
The unit tests cover the pipeline pieces in isolation; nothing exercised the whole
executor-driven path with real readers and real lifecycle transitions, which is where the
suspend/flush timing actually matters.
Additional Notes
The integration module consumes
testFixtures(project(":features:dd-sdk-android-rum"))andexcludes
tools:unit, a JVM-only test module that must not land on the Android test classpath;gsonandjUnit4are added astestFixturesImplementationso the androidTest consumer stillhas them at runtime.
Requires a connected device or emulator:
./gradlew :instrumented:integration:connectedDebugAndroidTest.Review checklist (to be filled by reviewers)
Ref: RUM-17613