Use the draw complete time for missing activity init timestamps#2121
Use the draw complete time for missing activity init timestamps#2121bidetofevil merged 1 commit intomainfrom
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
| @@ -272,15 +272,30 @@ internal class AppStartupTraceEmitter( | |||
| val startupService = startupServiceProvider() ?: return | |||
| val sdkInitEndMs = startupService.getSdkInitEndMs() | |||
| if (sdkInitEndMs != null) { | |||
There was a problem hiding this comment.
This is the main change. Everything else is renaming the callback method to be more appropriate
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2121 +/- ##
==========================================
+ Coverage 85.33% 85.35% +0.01%
==========================================
Files 470 470
Lines 10578 10590 +12
Branches 1564 1565 +1
==========================================
+ Hits 9027 9039 +12
+ Misses 870 869 -1
- Partials 681 682 +1
🚀 New features to boost your workflow:
|
| } else { | ||
| startupActivityResumedMs | ||
| } | ||
| val activityInitStartMs = cappedBy( |
There was a problem hiding this comment.
This is really to deal with the activityInit end event being missing, which is fired on onStarted() fires.
I am not sure if the init start event will ever be missing - for the Activity onCreate() callback to be processed after the draw, but I am handling this case just in case. After this is released, we can detect whether we have zero-duration child spans for activity init to see if it actually happens.
Merge activity
|
e200178 to
953dc60
Compare
953dc60 to
d04bb37
Compare

Goal
Activity init events might not be processed when the onDraw event fires because the latter jumps in front of the main thread handler queue. In these rare cases, use that timestamp in place of the activityInit timestamps.