Update profiling telemetry with more data#3240
Conversation
4bf8abd to
2d710ed
Compare
This comment has been minimized.
This comment has been minimized.
8fd82a9 to
6cc58e1
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3240 +/- ##
===========================================
+ Coverage 71.49% 71.57% +0.08%
===========================================
Files 934 935 +1
Lines 34628 34667 +39
Branches 5862 5865 +3
===========================================
+ Hits 24755 24810 +55
+ Misses 8231 8216 -15
+ Partials 1642 1641 -1
🚀 New features to boost your workflow:
|
637833e to
e4c1104
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4c11040ec
ℹ️ 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".
| sendProfilingEndTelemetry( | ||
| result = result, | ||
| duration = duration, | ||
| startReason = profilingStartReason, | ||
| appStartInfo = profilingAppStartInfo |
There was a problem hiding this comment.
Snapshot telemetry metadata before clearing running state
This callback reads profilingStartReason/profilingAppStartInfo from mutable fields after runningInstances is reset to empty, which allows a new start() call to win the CAS and overwrite those fields before telemetry is logged for the finishing session. In back-to-back profiling sessions (for example once non-launch reasons are used), the first session can emit the wrong start_reason and app_start_info values. Capture these values in local variables before reopening runningInstances (or make them request-scoped) so telemetry stays tied to the correct run.
Useful? React with 👍 / 👎.
|
|
||
| internal enum class ProfilingStartReason(val value: String) { | ||
|
|
||
| APPLICATION_LAUNCH("application_launch"), |
There was a problem hiding this comment.
Probably it will just go away with having continuous profiling? Or you see continuous profiling which is started not at the application launch, but at some point later?
There was a problem hiding this comment.
I don't think so, app launch profiling will always be there from app launch to TTID, continuous profiling will not start immediately according to the RFC, we will probably add a jitter window.
There was a problem hiding this comment.
Which is probably just a complexity we bring? It is possible to start continuous profiling at the application launch and have this only, given that we label samples with Vital ID/Vital Name anyway.
It seems the only reason to have Application Launch profiling separate is a distinct sampling frequency. But anyway, having it this way brings a complexity if there is feature operation started before TTID.
There was a problem hiding this comment.
Imagine we always start continuous profiling at the application launch and we try to extend this first profiling to maximum duration (let's say 1 min due to the payload size limitation) and then cooldown for 5 minutes, then the events happen during 1min ~ 6min is very likely to be missed.
We can defer this discussion in the RFC, but currently since continuous is not implemented yet, I think it still make sense to keep it here.
| @Volatile | ||
| private var profilingStartReason: String = "" | ||
|
|
||
| @Volatile | ||
| private var profilingAppStartInfo: String? = null |
There was a problem hiding this comment.
nit: it is better to use type-system at this point still, referencing enums and convert to String which is a generic type only when it is really needed, at the very last stage.
There was a problem hiding this comment.
updated profilingStartReason to enum type, added an UNKNOWN state in the enum as default.
| "file_size" to 0L, | ||
| "stopped_reason" to "timeout" | ||
| "stopped_reason" to "timeout", | ||
| "app_start_info" to null |
There was a problem hiding this comment.
nit: maybe app_start_origin would make a bit more sense
There was a problem hiding this comment.
here I follow the system api naming ApplicationStartInfo
There was a problem hiding this comment.
This telemetry is not unique to Android and its APIs, we can be a bit more precise, maybe even app_start_reason?
There was a problem hiding this comment.
I checked with @simaoseica-dd , he confirmed that this is not possible to get on IOS, so it's an Android specific field.
11a2d05 to
0df80be
Compare
0df80be to
77733bd
Compare
What does this PR do?
DdProfilingContentProviderto be more testableDdProfilingContentProviderTestReview checklist (to be filled by reviewers)