feat(profiling): Add measurements to Android profiling#6250
Merged
Conversation
Pass memory, CPU, and frame measurements from the Android SDK's ProfileEndData through the React Native bridge into profile events. The data was already collected by the native profiler but never forwarded to JS. Closes #3641 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 817959e. Configure here.
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 44c8b3f+dirty | 414.20 ms | 457.28 ms | 43.08 ms |
| 853723c+dirty | 405.54 ms | 440.08 ms | 34.54 ms |
| 890d145+dirty | 504.54 ms | 491.55 ms | -12.99 ms |
| a50b33d+dirty | 500.81 ms | 532.11 ms | 31.30 ms |
| d038a14+dirty | 415.60 ms | 461.04 ms | 45.45 ms |
| b9bebee+dirty | 438.86 ms | 452.21 ms | 13.35 ms |
| 5748023+dirty | 446.69 ms | 505.63 ms | 58.94 ms |
| 6177334+dirty | 408.16 ms | 441.14 ms | 32.98 ms |
| c004dae+dirty | 412.86 ms | 481.50 ms | 68.64 ms |
| 3b6e9f9+dirty | 442.70 ms | 486.44 ms | 43.74 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 44c8b3f+dirty | 48.30 MiB | 53.46 MiB | 5.15 MiB |
| 853723c+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 890d145+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
| a50b33d+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| d038a14+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| b9bebee+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 5748023+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| 6177334+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| c004dae+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 3b6e9f9+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
📲 Install BuildsAndroid
|
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 853723c+dirty | 3852.60 ms | 1234.64 ms | -2617.96 ms |
| a50b33d+dirty | 1197.74 ms | 1197.17 ms | -0.57 ms |
| 3d377b5+dirty | 1218.48 ms | 1219.51 ms | 1.03 ms |
| c151573+dirty | 3841.06 ms | 1232.13 ms | -2608.93 ms |
| 4b87b12+dirty | 1212.90 ms | 1222.09 ms | 9.19 ms |
| 7436d0f+dirty | 3851.58 ms | 1232.21 ms | -2619.38 ms |
| 267d3ed+dirty | 3853.65 ms | 1224.70 ms | -2628.94 ms |
| c004dae+dirty | 3850.32 ms | 1227.79 ms | -2622.53 ms |
| 5125c43+dirty | 3846.45 ms | 1221.12 ms | -2625.32 ms |
| ad66da3+dirty | 3820.96 ms | 1214.43 ms | -2606.52 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 853723c+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| a50b33d+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 3d377b5+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| c151573+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 7436d0f+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 267d3ed+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| c004dae+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 5125c43+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 853723c+dirty | 3849.33 ms | 1221.07 ms | -2628.26 ms |
| a50b33d+dirty | 1207.11 ms | 1212.10 ms | 5.00 ms |
| 3d377b5+dirty | 1201.55 ms | 1201.80 ms | 0.25 ms |
| c151573+dirty | 3835.64 ms | 1216.10 ms | -2619.53 ms |
| 4b87b12+dirty | 1199.49 ms | 1199.78 ms | 0.29 ms |
| 7436d0f+dirty | 3861.51 ms | 1231.07 ms | -2630.44 ms |
| 267d3ed+dirty | 3860.14 ms | 1223.39 ms | -2636.76 ms |
| c004dae+dirty | 3857.82 ms | 1224.87 ms | -2632.95 ms |
| 5125c43+dirty | 3827.94 ms | 1208.79 ms | -2619.15 ms |
| ad66da3+dirty | 3855.02 ms | 1213.43 ms | -2641.59 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 853723c+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| a50b33d+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 3d377b5+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| c151573+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 7436d0f+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 267d3ed+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| c004dae+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 5125c43+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a736b76+dirty | 405.78 ms | 458.74 ms | 52.96 ms |
| 853723c+dirty | 415.82 ms | 460.94 ms | 45.12 ms |
| 4953e94+dirty | 398.80 ms | 431.81 ms | 33.01 ms |
| 44c8b3f+dirty | 492.13 ms | 563.47 ms | 71.34 ms |
| d038a14+dirty | 405.08 ms | 444.36 ms | 39.28 ms |
| 0d9949d+dirty | 414.88 ms | 428.68 ms | 13.81 ms |
| b9bebee+dirty | 500.50 ms | 536.42 ms | 35.92 ms |
| 5748023+dirty | 413.71 ms | 468.71 ms | 54.99 ms |
| 7d6fd3a+dirty | 435.06 ms | 458.78 ms | 23.72 ms |
| 6177334+dirty | 404.80 ms | 456.74 ms | 51.94 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| a736b76+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 853723c+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 4953e94+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 44c8b3f+dirty | 48.30 MiB | 53.46 MiB | 5.15 MiB |
| d038a14+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 0d9949d+dirty | 43.94 MiB | 48.99 MiB | 5.05 MiB |
| b9bebee+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 5748023+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| 7d6fd3a+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
| 6177334+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
The standalone SentryFrameMetricsCollector created in initializeAndroidProfiler() missed the onActivityStarted callback because the activity was already started, so currentWindow was never set and no frame metrics were collected. Reuse the collector from SentryAndroidOptions instead, which is already tracking the active window from Sentry.init(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2b5745b. Configure here.
alwx
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Passes memory, CPU, and frame measurements from the Android SDK's
ProfileEndData.measurementsMapthrough the React Native bridge into profile events. The data was already collected by the native Android profiler but never forwarded to JS.💡 Motivation and Context
Closes #3641
💚 How did you test it?
Manual, Unit tests
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps