Skip to content

RUM-10347: Avoid polling for RumContext in VitalReaderRunnable#2728

Merged
0xnm merged 1 commit into
nogorodnikov/rum-8170/feature-context-syncfrom
nogorodnikov/rum-10347/avoid-polling-for-rumcontext-in-vital-runnable
Jun 16, 2025
Merged

RUM-10347: Avoid polling for RumContext in VitalReaderRunnable#2728
0xnm merged 1 commit into
nogorodnikov/rum-8170/feature-context-syncfrom
nogorodnikov/rum-10347/avoid-polling-for-rumcontext-in-vital-runnable

Conversation

@0xnm

@0xnm 0xnm commented Jun 13, 2025

Copy link
Copy Markdown
Member

What does this PR do?

VitalReaderRunnable currently calls getFeatureContext to check if RumContext has FOREGROUND type.

The problem is that these calls may happen quite often, like every 100ms, putting some pressure on the context thread and feature context locking mechanism.

This PR switches to another approach: VitalReaderRunnable will just listen for the RumContext updates, this should remove the performance pressure.

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)

@0xnm
0xnm requested review from a team as code owners June 13, 2025 14:27
@codecov-commenter

codecov-commenter commented Jun 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.87%. Comparing base (b136c9c) to head (7b83fcd).
⚠️ Report is 53 commits behind head on nogorodnikov/rum-8170/feature-context-sync.

Files with missing lines Patch % Lines
...android/rum/internal/vitals/VitalReaderRunnable.kt 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                              Coverage Diff                               @@
##           nogorodnikov/rum-8170/feature-context-sync    #2728      +/-   ##
==============================================================================
+ Coverage                                       69.78%   69.87%   +0.10%     
==============================================================================
  Files                                             824      824              
  Lines                                           30940    30947       +7     
  Branches                                         5190     5190              
==============================================================================
+ Hits                                            21589    21624      +35     
+ Misses                                           7874     7859      -15     
+ Partials                                         1477     1464      -13     
Files with missing lines Coverage Δ
...n/com/datadog/android/core/internal/DatadogCore.kt 76.77% <100.00%> (-0.16%) ⬇️
...lin/com/datadog/android/rum/internal/RumFeature.kt 92.46% <100.00%> (+0.15%) ⬆️
...android/rum/internal/vitals/VitalReaderRunnable.kt 95.00% <75.00%> (-5.00%) ⬇️

... and 34 files with indirect coverage changes

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

@0xnm
0xnm merged commit 97821b7 into nogorodnikov/rum-8170/feature-context-sync Jun 16, 2025
24 checks passed
@0xnm
0xnm deleted the nogorodnikov/rum-10347/avoid-polling-for-rumcontext-in-vital-runnable branch June 16, 2025 16:43
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