-
-
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 cpu usage collection #2462
Add cpu usage collection #2462
Conversation
…running TransactionPerformanceCollector now returns PerformanceCollectionData, which contains memory and cpu usage data
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
0ab0a9d | 297.22 ms | 316.27 ms | 19.05 ms |
cdfd579 | 291.23 ms | 343.10 ms | 51.87 ms |
5d33fcf | 338.68 ms | 376.60 ms | 37.92 ms |
1c5e2af | 294.08 ms | 355.10 ms | 61.02 ms |
82b794b | 334.81 ms | 382.72 ms | 47.91 ms |
c3caa7d | 407.24 ms | 421.16 ms | 13.92 ms |
0ceda44 | 337.69 ms | 355.46 ms | 17.77 ms |
20ea300 | 308.26 ms | 366.81 ms | 58.55 ms |
cdc5f35 | 366.06 ms | 404.48 ms | 38.42 ms |
0d15e40 | 346.22 ms | 383.28 ms | 37.06 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
0ab0a9d | 1.73 MiB | 2.33 MiB | 618.94 KiB |
cdfd579 | 1.73 MiB | 2.33 MiB | 618.94 KiB |
5d33fcf | 1.73 MiB | 2.33 MiB | 621.01 KiB |
1c5e2af | 1.73 MiB | 2.33 MiB | 620.95 KiB |
82b794b | 1.73 MiB | 2.33 MiB | 621.15 KiB |
c3caa7d | 1.73 MiB | 2.33 MiB | 621.00 KiB |
0ceda44 | 1.73 MiB | 2.33 MiB | 622.12 KiB |
20ea300 | 1.73 MiB | 2.33 MiB | 618.94 KiB |
cdc5f35 | 1.73 MiB | 2.33 MiB | 621.55 KiB |
0d15e40 | 1.73 MiB | 2.33 MiB | 621.01 KiB |
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
Codecov ReportBase: 80.08% // Head: 80.12% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2462 +/- ##
============================================
+ Coverage 80.08% 80.12% +0.03%
- Complexity 3904 3913 +9
============================================
Files 320 321 +1
Lines 14751 14779 +28
Branches 1950 1950
============================================
+ Hits 11813 11841 +28
- Misses 2168 2170 +2
+ Partials 770 768 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
sentry-android-core/src/main/java/io/sentry/android/core/AndroidCpuCollector.java
Show resolved
Hide resolved
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
@@ -162,7 +162,10 @@ static void initializeIntegrationsAndProcessors( | |||
options.setGestureTargetLocators(gestureTargetLocators); | |||
} | |||
options.setMainThreadChecker(AndroidMainThreadChecker.getInstance()); | |||
options.setMemoryCollector(new AndroidMemoryCollector()); | |||
if (options.getCollectors().isEmpty()) { |
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.
l
: just a thought - since this a list, should we just add to it no matter what? Even if the users added their own collectors, we could still add ours?
Not applicable for JavaMemoryCollector
though, since it'd be duplicating the values of AndroidMemoryCollector
kinda
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.
Actually, only the last added Collectors would work, so we'd overwrite user's defined collectors.
Maybe we could set them as first in the list, using something like collectors.add(0, collector)
However, at the moment the collector is marked @Internal
.
Should we cover this case anyway?
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.
LGTM 🚀
sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
Outdated
Show resolved
Hide resolved
# Conflicts: # sentry-android-core/api/sentry-android-core.api # sentry/src/main/java/io/sentry/SentryOptions.java
📜 Description
added ICpuCollector to collect cpu usage info while transactions are running
TransactionPerformanceCollector now returns PerformanceCollectionData, which contains both memory and cpu usage data
💡 Motivation and Context
We want to track a time series of cpu percentage usage while a transaction runs, to provide more info to the user.
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps