-
-
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 debouncing mechanism and before-capture callbacks for screenshots/vh #2773
Merged
Conversation
This file contains 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
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8820c5c | 330.60 ms | 416.86 ms | 86.26 ms |
496bdfd | 301.22 ms | 343.96 ms | 42.73 ms |
496bdfd | 272.86 ms | 407.33 ms | 134.48 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8820c5c | 1.72 MiB | 2.28 MiB | 571.82 KiB |
496bdfd | 1.72 MiB | 2.28 MiB | 571.82 KiB |
496bdfd | 1.72 MiB | 2.28 MiB | 571.82 KiB |
Previous results on branch: feat/debounce-screenshots-vh
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d3eea7e | 300.30 ms | 357.16 ms | 56.86 ms |
d54ccce | 274.06 ms | 313.64 ms | 39.58 ms |
14a2eda | 309.83 ms | 421.20 ms | 111.37 ms |
40f6a9d | 281.74 ms | 355.69 ms | 73.95 ms |
eff78ed | 306.31 ms | 380.76 ms | 74.45 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d3eea7e | 1.72 MiB | 2.28 MiB | 572.01 KiB |
d54ccce | 1.72 MiB | 2.28 MiB | 572.01 KiB |
14a2eda | 1.72 MiB | 2.28 MiB | 571.93 KiB |
40f6a9d | 1.72 MiB | 2.28 MiB | 571.93 KiB |
eff78ed | 1.72 MiB | 2.28 MiB | 571.93 KiB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2773 +/- ##
============================================
+ Coverage 81.10% 81.14% +0.03%
- Complexity 4476 4497 +21
============================================
Files 347 348 +1
Lines 16499 16677 +178
Branches 2236 2267 +31
============================================
+ Hits 13381 13532 +151
- Misses 2183 2198 +15
- Partials 935 947 +12
☔ View full report in Codecov by Sentry. |
stefanosiano
reviewed
Jun 6, 2023
sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java
Show resolved
Hide resolved
stefanosiano
reviewed
Jun 6, 2023
sentry-android-core/src/test/java/io/sentry/android/core/internal/util/DebouncerTest.kt
Outdated
Show resolved
Hide resolved
stefanosiano
reviewed
Jun 6, 2023
sentry-android-core/src/test/java/io/sentry/android/core/ViewHierarchyEventProcessorTest.kt
Show resolved
Hide resolved
stefanosiano
reviewed
Jun 6, 2023
sentry-android-core/src/test/java/io/sentry/android/core/ScreenshotEventProcessorTest.kt
Show resolved
Hide resolved
stefanosiano
reviewed
Jun 6, 2023
sentry-android-core/src/main/java/io/sentry/android/core/ViewHierarchyEventProcessor.java
Show resolved
Hide resolved
just a couple tests and comments, but looks good! |
stefanosiano
approved these changes
Jun 6, 2023
romtsn
reviewed
Jun 15, 2023
sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java
Show resolved
Hide resolved
romtsn
approved these changes
Jun 15, 2023
…entry-java into feat/debounce-screenshots-vh
sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java
Show resolved
Hide resolved
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
As discussed we want to debounce the capturing of screenshots / view hierarchies. As of now I hard-coded the debouncing time to 2 seconds, thus in worst case capturing is happening every 2 seconds.
On top of that a new
beforeCapture
callback is introduced, to allow even more customization and eventually overrule the debouncing mechanism. This callback can also be used to prevent capturing for non-fatal events.💡 Motivation and Context
Fixes #2713 and #2665
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps