Clear window reference only on activity stop in profileMeasurements collector#2407
Merged
Conversation
…d only after the activity stops, and no more when the profiler stops
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 31f3e4c | 325.22 ms | 342.77 ms | 17.55 ms |
| 81a1a6c | 328.73 ms | 421.28 ms | 92.55 ms |
| 7597ded | 289.60 ms | 339.69 ms | 50.09 ms |
| 507f924 | 342.51 ms | 402.65 ms | 60.14 ms |
| 38e4f11 | 358.20 ms | 433.73 ms | 75.53 ms |
| 3695453 | 301.78 ms | 371.14 ms | 69.36 ms |
| 81a1a6c | 294.04 ms | 341.19 ms | 47.15 ms |
| 4a9c176 | 319.77 ms | 363.20 ms | 43.43 ms |
| 16371c5 | 314.02 ms | 394.54 ms | 80.52 ms |
| f809aac | 301.51 ms | 346.60 ms | 45.09 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 31f3e4c | 1.73 MiB | 2.32 MiB | 612.47 KiB |
| 81a1a6c | 1.73 MiB | 2.32 MiB | 612.47 KiB |
| 7597ded | 1.73 MiB | 2.32 MiB | 609.88 KiB |
| 507f924 | 1.73 MiB | 2.32 MiB | 609.95 KiB |
| 38e4f11 | 1.73 MiB | 2.32 MiB | 609.82 KiB |
| 3695453 | 1.73 MiB | 2.32 MiB | 611.62 KiB |
| 81a1a6c | 1.73 MiB | 2.32 MiB | 612.47 KiB |
| 4a9c176 | 1.73 MiB | 2.33 MiB | 612.69 KiB |
| 16371c5 | 1.73 MiB | 2.32 MiB | 611.62 KiB |
| f809aac | 1.73 MiB | 2.32 MiB | 608.63 KiB |
Previous results on branch: fix/profiling-metrics-missing
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c7f9e2c | 307.46 ms | 321.12 ms | 13.66 ms |
| 2998e46 | 284.45 ms | 318.54 ms | 34.09 ms |
| ea5fc7c | 281.34 ms | 343.08 ms | 61.74 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| c7f9e2c | 1.73 MiB | 2.32 MiB | 612.36 KiB |
| 2998e46 | 1.73 MiB | 2.32 MiB | 612.45 KiB |
| ea5fc7c | 1.73 MiB | 2.32 MiB | 612.36 KiB |
Codecov ReportBase: 80.03% // Head: 80.03% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #2407 +/- ##
=========================================
Coverage 80.03% 80.03%
Complexity 3765 3765
=========================================
Files 301 301
Lines 14207 14207
Branches 1884 1884
=========================================
Hits 11371 11371
Misses 2092 2092
Partials 744 744 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. |
stefanosiano
marked this pull request as ready for review
December 2, 2022 01:13
stefanosiano
requested review from
adinauer,
markushi and
romtsn
as code owners
December 2, 2022 01:13
markushi
approved these changes
Dec 2, 2022
markushi
left a comment
Member
There was a problem hiding this comment.
LGTM, please have a look at my comment
…nto fix/profiling-metrics-missing
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.
📜 Description
the current window reference in SentryFrameMetricsCollector is cleared only after the activity stops, and no more when the profiler stops
💡 Motivation and Context
We need the reference to the current window to attach or detach frameMetrics listeners. Currently, when the profiler stops we clear this reference. This means that if the profiler is restarted in the same activity, we cannot attach the frameMetrics listener because we don't have the reference to the window.
So we are having profiles without measurements, especially when auto instrumentation starts (and stops) profiler when an activity is started
💚 How did you test it?
Added a unit test
📝 Checklist
🔮 Next steps