Conversation
Fix SentrySystemWrapper CPU usage calculation by dividing Mach thread cpu_usage by TH_USAGE_SCALE, then normalizing by processor count and converting to 0..100 percent. Updates docs and adds test for the normalization logic.
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7798 +/- ##
=============================================
- Coverage 85.416% 85.411% -0.005%
=============================================
Files 487 487
Lines 29190 29195 +5
Branches 12625 12652 +27
=============================================
+ Hits 24933 24936 +3
- Misses 4207 4210 +3
+ Partials 50 49 -1
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
📲 Install BuildsiOS
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 21fb20e | 1217.43 ms | 1230.91 ms | 13.48 ms |
| 16b3235 | 1234.51 ms | 1257.84 ms | 23.33 ms |
| fd24b7c | 1222.39 ms | 1259.67 ms | 37.28 ms |
| d6d7fcf | 1192.78 ms | 1215.60 ms | 22.83 ms |
| d0b4402 | 1218.62 ms | 1241.80 ms | 23.18 ms |
| db9e223 | 1193.69 ms | 1213.56 ms | 19.87 ms |
| e92ab66 | 1228.86 ms | 1258.43 ms | 29.57 ms |
| bed2eb7 | 1215.88 ms | 1247.14 ms | 31.27 ms |
| 06cf46a | 1222.49 ms | 1261.13 ms | 38.64 ms |
| 09a80f2 | 1214.78 ms | 1237.85 ms | 23.07 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 21fb20e | 24.14 KiB | 1.12 MiB | 1.09 MiB |
| 16b3235 | 24.14 KiB | 1.11 MiB | 1.09 MiB |
| fd24b7c | 24.14 KiB | 1.07 MiB | 1.04 MiB |
| d6d7fcf | 24.14 KiB | 1.12 MiB | 1.10 MiB |
| d0b4402 | 24.14 KiB | 1.11 MiB | 1.08 MiB |
| db9e223 | 24.14 KiB | 1.06 MiB | 1.03 MiB |
| e92ab66 | 24.14 KiB | 1.10 MiB | 1.08 MiB |
| bed2eb7 | 24.14 KiB | 1.07 MiB | 1.04 MiB |
| 06cf46a | 24.14 KiB | 1.13 MiB | 1.10 MiB |
| 09a80f2 | 24.14 KiB | 1.10 MiB | 1.08 MiB |
philprime
left a comment
There was a problem hiding this comment.
LGTM but I have one concern: Isn't this technically speaking a breaking change because the reported data and any related dashboards will report completely different numbers from now on?
📜 Description
Fix SentrySystemWrapper CPU usage calculation by dividing Mach thread cpu_usage by TH_USAGE_SCALE, then normalizing by processor count and converting to 0..100 percent. Updates docs and adds test for the normalization logic.
💡 Motivation and Context
Closes #7456
💚 How did you test it?
Unit Tests
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.