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

feat(profiling): Remove SentryOptions deps from AndroidProfiler #3051

Merged
merged 25 commits into from
Nov 17, 2023

Conversation

krystofwoldrich
Copy link
Member

📜 Description

This PR refactors the AndroidProfiler interface so HybridSDKs can create the profiler without AndroidSDK initialized.

In practice, this means removing SentryOptions from the constructor and replacing it with enumerations of the dependencies, which HybridSDKs can create independent of the AndroidSDK.

💡 Motivation and Context

This enabled Android/RN mixed profiles.

💚 How did you test it?

RN sample app

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@krystofwoldrich krystofwoldrich changed the title chore(profiling): Create independent Profiler for Hybrid SDKs feature(profiling): Remove SentryOptions deps from AndroidProfiler Nov 15, 2023
@krystofwoldrich krystofwoldrich changed the title feature(profiling): Remove SentryOptions deps from AndroidProfiler fix(profiling): Remove SentryOptions deps from AndroidProfiler Nov 15, 2023
@krystofwoldrich krystofwoldrich self-assigned this Nov 15, 2023
Copy link
Contributor

github-actions bot commented Nov 15, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 381.36 ms 454.49 ms 73.13 ms
Size 1.72 MiB 2.29 MiB 578.15 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
99a51e2 405.11 ms 479.65 ms 74.54 ms
4bf95dd 345.96 ms 414.24 ms 68.28 ms
c7e2fbc 398.35 ms 468.52 ms 70.17 ms
a3c77bc 375.80 ms 445.85 ms 70.06 ms
93a76ca 378.48 ms 451.78 ms 73.30 ms
c3f503e 360.41 ms 434.67 ms 74.27 ms
93a76ca 397.30 ms 455.16 ms 57.87 ms
3d8bd2b 364.76 ms 469.98 ms 105.22 ms
c7e2fbc 372.00 ms 461.71 ms 89.71 ms
7ca9895 364.31 ms 460.46 ms 96.15 ms

App size

Revision Plain With Sentry Diff
99a51e2 1.72 MiB 2.29 MiB 576.34 KiB
4bf95dd 1.72 MiB 2.29 MiB 576.40 KiB
c7e2fbc 1.72 MiB 2.29 MiB 576.40 KiB
a3c77bc 1.72 MiB 2.29 MiB 577.53 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
c3f503e 1.72 MiB 2.29 MiB 577.04 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
3d8bd2b 1.72 MiB 2.29 MiB 577.53 KiB
c7e2fbc 1.72 MiB 2.29 MiB 576.40 KiB
7ca9895 1.72 MiB 2.29 MiB 576.51 KiB

Previous results on branch: kw-hybrid-profiling

Startup times

Revision Plain With Sentry Diff
64dd83e 387.84 ms 466.16 ms 78.32 ms
d6884f8 387.10 ms 453.73 ms 66.63 ms
ce7d724 396.55 ms 476.31 ms 79.76 ms

App size

Revision Plain With Sentry Diff
64dd83e 1.72 MiB 2.29 MiB 578.47 KiB
d6884f8 1.72 MiB 2.29 MiB 578.47 KiB
ce7d724 1.72 MiB 2.29 MiB 578.47 KiB

Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

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

Nice one, very clean cut! 🥷

CHANGELOG.md Show resolved Hide resolved
@krystofwoldrich krystofwoldrich changed the title fix(profiling): Remove SentryOptions deps from AndroidProfiler feat(profiling): Remove SentryOptions deps from AndroidProfiler Nov 15, 2023
Copy link
Contributor

github-actions bot commented Nov 15, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8e97da6

@krystofwoldrich krystofwoldrich enabled auto-merge (squash) November 17, 2023 09:02
@krystofwoldrich krystofwoldrich merged commit 8838e01 into main Nov 17, 2023
17 of 19 checks passed
@krystofwoldrich krystofwoldrich deleted the kw-hybrid-profiling branch November 17, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants