Skip to content
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] Capture gestures/motion events #3390

Open
wants to merge 9 commits into
base: rz/feat/session-replay
Choose a base branch
from

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Apr 25, 2024

#skip-changelog

📜 Description

  • Adds touch event interceptor to WindowRecorder
  • Converts those to RRWebIncrementalSnapshotEvents
    • For up/down events we convert to MouseInteraction source with type TouchStart/TouchCancel/TouchEnd
    • For move events we convert to TouchMove source with a list of positions
  • We also debounce/throttle only move events every 50ms as those can be overwhelming and capture them every 500ms (same as rrweb doing for web). For up/down/cancel we don't throttle as those are indicating start/end of gesture and are important to capture.
  • Fixed MapObjectReader along the way again, as it wasn't handling properly collections with deserializers

Here's an example event but playback not yet working: https://sentry-sdks.sentry.io/replays/d297a781640d4f8f966dd0cba27cf142/?project=5428559&query=&referrer=%2Freplays%2F%3AreplaySlug%2F&statsPeriod=1h&t_main=breadcrumbs&yAxis=count%28%29&t=0

💡 Motivation and Context

Part of getsentry/sentry#70065

* to change the menu param from non null to nullable to avoid runtime null check crashes. Issue:
* https://issuetracker.google.com/issues/188568911
*/
public class FixedWindowCallback implements Window.Callback {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we have WindowCallbackAdapter, but I don't wanna depend on sentry-android-core just for that single class, so I've added another one (enhanced, as it fixes an NPE actually)

Copy link
Contributor

github-actions bot commented Apr 25, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 461.35 ms 479.57 ms 18.22 ms
Size 1.70 MiB 2.33 MiB 640.05 KiB

Baseline results on branch: rz/feat/session-replay

Startup times

Revision Plain With Sentry Diff
54ce31d 356.89 ms 426.10 ms 69.21 ms
9576d82 413.17 ms 484.73 ms 71.56 ms
a3367a7 364.14 ms 460.69 ms 96.54 ms
8e7260f 367.84 ms 445.06 ms 77.22 ms
9bab4f1 418.92 ms 474.58 ms 55.67 ms
03fdaa2 364.22 ms 448.15 ms 83.92 ms
4905abb 394.22 ms 532.53 ms 138.31 ms

App size

Revision Plain With Sentry Diff
54ce31d 1.70 MiB 2.31 MiB 627.54 KiB
9576d82 1.70 MiB 2.31 MiB 627.54 KiB
a3367a7 1.70 MiB 2.32 MiB 635.88 KiB
8e7260f 1.70 MiB 2.31 MiB 627.54 KiB
9bab4f1 1.70 MiB 2.32 MiB 635.88 KiB
03fdaa2 1.70 MiB 2.32 MiB 635.88 KiB
4905abb 1.70 MiB 2.31 MiB 627.54 KiB

Previous results on branch: rz/feat/session-replay-touch-events

Startup times

Revision Plain With Sentry Diff
0a9348e 330.94 ms 405.53 ms 74.59 ms
c5a385c 371.06 ms 433.14 ms 62.08 ms

App size

Revision Plain With Sentry Diff
0a9348e 1.70 MiB 2.32 MiB 638.56 KiB
c5a385c 1.70 MiB 2.33 MiB 638.75 KiB

@romtsn romtsn marked this pull request as ready for review May 6, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant