Address concurrency and app start detection issues in Profiling#3117
Conversation
fbee0fc to
978b12f
Compare
978b12f to
2f753fd
Compare
|
🎯 Code Coverage 🔗 Commit SHA: 2f753fd | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
| val endTime = timeProvider.getDeviceTimestampMillis() | ||
| val duration = endTime - profilingStartTime | ||
| if (result.errorCode == ProfilingResult.ERROR_NONE) { | ||
| // TODO RUM-13679: need to delete the file after it is no longer needed |
There was a problem hiding this comment.
ProfilingManager stores the result as a temp file and it will be cleaned up automatically, I don't think we need to handle it by us.
There was a problem hiding this comment.
it will be cleaned up automatically
do you know the cleanup logic? because we store the path to the file, so is there any risk that by the time we try to read from this path file is not there already?
the location given is not in the cache folder
There was a problem hiding this comment.
I don't know how it is cleaned under the hood exactly, but I guess we will probably not hit the this risk since from the callback to writing batch, it has very small delay (although we switch the thread).
I think we can add a telemetry to monitor if we can actually hit the case where we fail the read the result with the this path.
There was a problem hiding this comment.
From my runs I see that profiling results are stored on the device like forever. Maybe they are cleaned up though once /data/data/<app>/files/profiling folder hits certain size.
There was a problem hiding this comment.
Google claims that to keep the results forever we need to enable a flag through adb, let's confirm with them about this.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/perfetto-profiling #3117 +/- ##
==============================================================
+ Coverage 71.43% 71.54% +0.11%
==============================================================
Files 894 894
Lines 32821 32838 +17
Branches 5512 5516 +4
==============================================================
+ Hits 23444 23491 +47
+ Misses 7811 7791 -20
+ Partials 1566 1556 -10
🚀 New features to boost your workflow:
|
What does this PR do?
This PR does the following:
Review checklist (to be filled by reviewers)