RUM-16394 Pt.3: Wire Quota Checker with Profiling Feature#3538
Conversation
This comment has been minimized.
This comment has been minimized.
fea1964 to
7c1603d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/continuous-profiling #3538 +/- ##
================================================================
+ Coverage 72.45% 72.46% +0.02%
================================================================
Files 986 987 +1
Lines 36513 36579 +66
Branches 6077 6093 +16
================================================================
+ Hits 26452 26506 +54
Misses 8406 8406
- Partials 1655 1667 +12
🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c1603d123
ℹ️ 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".
853fe02 to
2521419
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 252141911d
ℹ️ 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".
2521419 to
06b58d4
Compare
06b58d4 to
2aa78ac
Compare
| val quotaCallFactory = sdkCore.createOkHttpCallFactory { | ||
| callTimeout(QUOTA_CHECK_TIMEOUT_MS, TimeUnit.MILLISECONDS) | ||
| } | ||
| val qExecutor = sdkCore.createSingleThreadExecutorService(QUOTA_EXECUTOR_CONTEXT) |
There was a problem hiding this comment.
maybe it is worth reusing existing uploadExecutorService executor or executor for the profiling? The latter is used to run only profiling submission tasks, which are short and quick, so it has plenty of room for another scheduling.
There was a problem hiding this comment.
The issue is not profiling submission block quota checker, but oppositely the network request in QuotaCheck can block the profiling submission, which might disorder the continuous profiling cycle or callback of ProfilingManager.
There was a problem hiding this comment.
the network request in QuotaCheck can block the profiling submission
I guess this is the case for the Profiling executor, but what about uploadExecutorService then?
There was a problem hiding this comment.
yes, using uploadExecutorService doesn't have this problem, but I don't think ProfilingFeature has access to uploadExecutorService in the CoreFeature
There was a problem hiding this comment.
It is not exposed via API, but it is not a problem with exposing it somehow. Or we can use InternalSdkCore.getPersistenceExecutorService for that (hacky, but works).
Realistically we create a thread just to run (once per session, ideally) a quick task, and most of the time it will be idling. SDK has already too much threads and we must pack work across existing threads.
We can keep the current approach, but we need to revisit it later.
There was a problem hiding this comment.
I just let Claude investigate the source code for the same purpose, here is the result:
With all features enabled, roughly 19–24 threads per SDK instance:
- Core: 4 (shared, justified)
- RUM: ~6 (pipeline, anr, vital, + one per active tracking strategy)
- Profiling: 2
- Session Replay: 3–12 (resource pool scales 1→10)
- Flags: 2
- Trace: 3 (some are process-wide singletons, not per-instance)
Smells like an Android Guild task, I will create a ticket

What does this PR do?
Connects the ProfilingQuotaChecker to the Profiling Feature so profiling is gated on the backend quota decision, and surfaces the quota outcome on RUM events.
Motivation
ProfilingFeaturefires an async quota check (createOkHttpCallFactory + dedicated single-thread executor, 5s call timeout).Review checklist (to be filled by reviewers)