RUM-15321: Continuous profiling writes are gated on pending RUM events#3310
Conversation
e56483e to
48af4ae
Compare
This comment has been minimized.
This comment has been minimized.
48af4ae to
3b707c8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/continuous-profiling #3310 +/- ##
================================================================
+ Coverage 71.50% 71.56% +0.06%
================================================================
Files 948 948
Lines 35039 35072 +33
Branches 5937 5945 +8
================================================================
+ Hits 25052 25096 +44
+ Misses 8313 8295 -18
- Partials 1674 1681 +7
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b707c8843
ℹ️ 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".
2067c2a to
0587586
Compare
|
|
||
| override fun write( | ||
| profilingResult: PerfettoResult, | ||
| rumContext: ProfilingRumContext, |
There was a problem hiding this comment.
I don't think it should be a single ProfilingRumContext, it should be the aggregation here.
| testedFeature = ProfilingFeature( | ||
| mockSdkCore, | ||
| ProfilingConfiguration( | ||
| customEndpointUrl = null, | ||
| applicationLaunchSampleRate = 100f, | ||
| continuousSampleRate = 100f | ||
| ), | ||
| mockProfiler | ||
| ) |
There was a problem hiding this comment.
shouldn't we pull this to the common setup method?
There was a problem hiding this comment.
testedFeature needs to be initialized with a full sample rate configuration in some tests, I added a fakeAllSampledConfiguration to reuse.
| return this | ||
| } | ||
|
|
||
| fun hasLongTaskIds(expected: List<String>?): ProfileEventAssert { |
There was a problem hiding this comment.
seems it is not used anywhere so far? is it supposed to be used in this PR?
There was a problem hiding this comment.
it belongs to my next PR, it's a miss when splitting, removed.
| assertThat(testedScheduler.pendingLongTasks).isEqualTo(listOf(fakeRumLongTaskEvent)) | ||
| assertThat(testedScheduler.pendingAnrEvents).isEqualTo(listOf(fakeRumAnrEvent)) |
There was a problem hiding this comment.
tip: alternatively containsOnly can be used to avoid extra listOf call
| assertThat(testedScheduler.pendingLongTasks).isEqualTo(listOf(fakeRumLongTaskEvent)) | |
| assertThat(testedScheduler.pendingAnrEvents).isEqualTo(listOf(fakeRumAnrEvent)) | |
| assertThat(testedScheduler.pendingLongTasks).containsOnly(fakeRumLongTaskEvent) | |
| assertThat(testedScheduler.pendingAnrEvents).containsOnly(fakeRumAnrEvent) |
0587586 to
590883f
Compare
What does this PR do?
Long task events and ANR Error events are forwarded to
ContinuousProfilingSchedulerwhen they are received byProfilingFeature. Before we try to write the events for continuous profiling, we check if there are pending RUM events, this respects the fact that continuous profiling result should only be uploaded when there are crucial RUM events during the profiling.Note:
ContinuousProfilingScheduleronly accepts the RUM events when the active window is open (profiler is running), otherwise the events will be dropped since they are not happening during the profiling window.Motivation
RUM-15321
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)