-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Send transaction memory stats in profile payload #2447
Conversation
…ndroid set in SentryOptions Added TransactionPerformanceCollector to collect performance data while a transaction is running
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e10a9e0 | 344.18 ms | 370.08 ms | 25.90 ms |
a3feb29 | 319.24 ms | 392.94 ms | 73.69 ms |
851e2e8 | 345.82 ms | 379.59 ms | 33.77 ms |
04b7c64 | 327.04 ms | 395.22 ms | 68.18 ms |
3ac4b7e | 274.90 ms | 359.72 ms | 84.82 ms |
b1b6fc0 | 308.18 ms | 334.90 ms | 26.72 ms |
e5f16c4 | 269.00 ms | 334.24 ms | 65.24 ms |
68b24b4 | 317.52 ms | 353.14 ms | 35.62 ms |
ca688d7 | 335.90 ms | 376.63 ms | 40.73 ms |
2a6ff10 | 341.69 ms | 398.55 ms | 56.86 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e10a9e0 | 1.73 MiB | 2.33 MiB | 622.30 KiB |
a3feb29 | 1.73 MiB | 2.33 MiB | 622.25 KiB |
851e2e8 | 1.73 MiB | 2.33 MiB | 617.24 KiB |
04b7c64 | 1.73 MiB | 2.33 MiB | 622.30 KiB |
3ac4b7e | 1.73 MiB | 2.33 MiB | 620.89 KiB |
b1b6fc0 | 1.73 MiB | 2.33 MiB | 620.89 KiB |
e5f16c4 | 1.73 MiB | 2.33 MiB | 622.30 KiB |
68b24b4 | 1.73 MiB | 2.33 MiB | 620.63 KiB |
ca688d7 | 1.73 MiB | 2.33 MiB | 620.69 KiB |
2a6ff10 | 1.73 MiB | 2.33 MiB | 620.69 KiB |
Codecov ReportBase: 80.12% // Head: 80.13% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2447 +/- ##
=========================================
Coverage 80.12% 80.13%
- Complexity 3916 3917 +1
=========================================
Files 321 321
Lines 14783 14788 +5
Branches 1951 1951
=========================================
+ Hits 11845 11850 +5
Misses 2170 2170
Partials 768 768
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. |
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/SentryTracer.java # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java # sentry/src/test/java/io/sentry/TransactionPerformanceCollectorTest.kt
…running TransactionPerformanceCollector now returns PerformanceCollectionData, which contains memory and cpu usage data
…s, instead of being created in every Hub
…files-memory-measurement
…emory-measurement # Conflicts: # CHANGELOG.md
AndroidTransactionProfiler now gets an instance of PerformanceCollectionData instead of MemoryCollectionData
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
…emory-measurement # Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
# Conflicts: # CHANGELOG.md # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java
will take a look after the cpu PR is merged, otherwise the diff contains the changes from there as well |
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.
Nicely done, looking good! I might be missing something but as far as I can see the CPU data is not serialized / added as a measurement to the profile protocol, right? I'm looking at AndroidTransactionProfiler.putPerformanceCollectionDataInMeasurements
sentry-android-core/src/main/java/io/sentry/android/core/AndroidCpuCollector.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidCpuCollector.java
Show resolved
Hide resolved
} | ||
} | ||
} | ||
}, | ||
0, | ||
TRANSACTION_COLLECTION_INTERVAL_MILLIS, |
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.
m
: any reason you're providing a delay parameter here?
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.
so we let some time pass between setup() and collect() calls.
This way ICollectors that collect average stats based on time intervals, like AndroidCpuCollector, can have an actual time interval to evaluate.
Just added a comment to clarify it
I'm doing another pr for sending the cpu data, so yeah, they're not added to the profile, yet |
# Conflicts: # CHANGELOG.md # sentry-android-core/api/sentry-android-core.api # sentry-android-core/src/main/java/io/sentry/android/core/AndroidCpuCollector.java # sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java # sentry-android-core/src/test/java/io/sentry/android/core/AndroidCpuCollectorTest.kt # sentry-android-core/src/test/java/io/sentry/android/core/AndroidMemoryCollectorTest.kt # sentry/api/sentry.api # sentry/src/main/java/io/sentry/PerformanceCollectionData.java # sentry/src/main/java/io/sentry/SentryOptions.java # sentry/src/main/java/io/sentry/TransactionPerformanceCollector.java # sentry/src/test/java/io/sentry/JavaMemoryCollectorTest.kt # sentry/src/test/java/io/sentry/TransactionPerformanceCollectorTest.kt
📜 Description
Added list of MemoryCollectionData to Android profiles payload as measurements
💡 Motivation and Context
We want to add more data to profiles, so we are including the memory statistics we get from transactions to profile payloads.
Also, at the moment there's no easy way to send the data in the transaction, due to transaction metrics not supporting lists of data. We want to have some data and eventually show it in the Sentry dashboard. The quickest way is to send them in the profiles.
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps