-
-
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
[SR] Add screenshot recorder #3203
[SR] Add screenshot recorder #3203
Conversation
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
acb8705 | 340.75 ms | 368.17 ms | 27.42 ms |
6d9e721 | 383.10 ms | 458.98 ms | 75.88 ms |
268db42 | 415.38 ms | 481.70 ms | 66.31 ms |
4ffa796 | 382.90 ms | 445.32 ms | 62.42 ms |
007a5ae | 383.88 ms | 455.89 ms | 72.02 ms |
6c0fe29 | 381.20 ms | 444.18 ms | 62.98 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
acb8705 | 1.70 MiB | 2.27 MiB | 584.69 KiB |
6d9e721 | 1.70 MiB | 2.27 MiB | 584.69 KiB |
268db42 | 1.70 MiB | 2.27 MiB | 584.69 KiB |
4ffa796 | 1.70 MiB | 2.27 MiB | 584.69 KiB |
007a5ae | 1.70 MiB | 2.27 MiB | 584.69 KiB |
6c0fe29 | 1.70 MiB | 2.27 MiB | 584.69 KiB |
sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/Windows.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleFrameMuxer.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt
Show resolved
Hide resolved
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.
Looks great.
Some comments to discuss.
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
Outdated
Show resolved
Hide resolved
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.
Not much to review for me here, because, as you're saying, "This is just a dump of the PoC".
I'd be interested to see the refactored version that would be usable from outside sentry-java
sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleFrameMuxer.kt
Outdated
Show resolved
Hide resolved
You got to tell me what do you want to have exposed then :) |
I imagine the code that captures images is going to be separate from the code that produces the video, at least from your description how it's going to be done in two steps in order to avoid loses during crashes. |
Yeah, this makes sense, I'll create a new method in SimpleVideoEncoder that creates a video out of a bitmap list. But this:
I'm not sure. Don't we usually do that on the hybrid SDK level and then just pass the envelope bytes to |
In this case we won't be creating the envelope in dart due to the cost of transferring the data. Instead, sentry-dart has a native kotlin binding that would call native functions to create and send the envelope. |
Alright, let me give it a stab for the Android SDK first and then we can discuss in the following PR what has to be changed and so on. I imagine this is all the glue code I'm gonna write to connect recording and envelopes that is the most valuable for you. |
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.
Looking good overall! Left a few comments. We probably can improve on caching / handling bitmap allocation as they seem to happen in multiple places.
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/WindowRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/WindowRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Outdated
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Show resolved
Hide resolved
sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
Outdated
Show resolved
Hide resolved
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.
Nice one, looks great!
#skip-changelog
This is just a dump of the PoC phase more-or-less, so a lot will be refactored and made pretty, but you're welcome to review nonetheless. I've tried to left TODOs where I see changes forthcoming
Relates to: