Use embrace clock in UI load tracing#2278
Conversation
| private val logger: EmbLogger, | ||
| manualEnd: Boolean, | ||
| private val processCreatedMs: Long? = if (versionChecker.isAtLeast(VERSION_CODES.N)) { | ||
| Process.getStartElapsedRealtime() |
There was a problem hiding this comment.
This returns 0 in tests and is used as the span start time. I therefore moved it to the constructor so that we can supply a fake value for our assertions.
There was a problem hiding this comment.
Huh. We can wrap the Process object and fake it as well
| parent = this, | ||
| ) | ||
| } | ||
| val startMs = applicationInitStartMs |
There was a problem hiding this comment.
Assumed this was a bug, if not then the assertion in the tests is wrong.
There was a problem hiding this comment.
Good thing is that applicationInitEnd() isn't called often right now. I'll need to fix this before we merge the bytecode instrumentation change
There was a problem hiding this comment.
Oh I see this logic was changed in this commit? I'll just take a look at this as a whole
ddc8001 to
a6a4718
Compare
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
6adf496 to
ada8cc7
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2278 +/- ##
==========================================
- Coverage 85.17% 85.16% -0.01%
==========================================
Files 476 477 +1
Lines 10557 10552 -5
Branches 1551 1550 -1
==========================================
- Hits 8992 8987 -5
Misses 894 894
Partials 671 671
🚀 New features to boost your workflow:
|
Goal
Uses the embrace clock in UI load tracing rather than the OTel Java clock. This required some changes to the test assertions.