-
-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add collectors and background service for measurements #2239
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Add collectors and background service for measurements ([#2239](https://github.com/getsentry/sentry-java/pull/2239)) If none of the above apply, you can opt out of this check by adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just gave this a quick glance as it's a big PR. @adinauer, what's the current state of this PR?
@philipphofmann the exact measurements we collect are still in flux but the code around it could be given a high level review regarding its concept. |
Long clockTicks = parseClockTicks(stat); | ||
|
||
// TODO 2-4 ms on first read, then cached 4 - 20 μs | ||
List<Integer> maxFrequencies = CpuInfoUtils.getInstance().readMaxFrequencies(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to return useful data on my emulator, need to wait for new device to arrive to retest.
&& startRealtimeNanos != null | ||
&& startElapsedTimeMs != null) { | ||
// TODO SystemClock.elapsedRealtimeNanos() + Process.getElapsedCpuTime() take 9 - 15 μs | ||
Long diffRealtimeNanos = SystemClock.elapsedRealtimeNanos() - startRealtimeNanos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like our best bet as it's very fast and can be done synchronously. Probably also less risk of being taken away than reading /proc/self/stat
NOTE: The difference for Process.getElapsedCpuTime()
might be higher than for SystemClock.elapsedRealtimeNanos()
if multiple cores are under load.
Performance metrics 🚀
|
superseded by #2445 |
📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
🔮 Next steps