-
-
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
Startup Profiling 3 - Add ContentProvider and start profile #3128
Startup Profiling 3 - Add ContentProvider and start profile #3128
Conversation
… available if a startup profiler was instantiated, it will be reused in AndroidOptionsInitializer, instead of creating a new one added ITransactionProfiler.isRunning startup profiler and sampling decision is stored in AppStartMetrics startup profile is bound to the startup transaction added io.sentry.profiling.enable-startup manifest option moved profilingTracesHz from SentryAndroidOptions to SentryOptions added SentryStartupProfilingProvider
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
f19450a | 394.36 ms | 473.10 ms | 78.74 ms |
47df090 | 386.30 ms | 467.52 ms | 81.22 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
f19450a | 1.70 MiB | 2.27 MiB | 583.38 KiB |
47df090 | 1.72 MiB | 2.27 MiB | 561.22 KiB |
Previous results on branch: feat/startup-profiling3-start-profiler
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
691b9d3 | 576.60 ms | 706.33 ms | 129.73 ms |
9a38f08 | 396.55 ms | 478.92 ms | 82.37 ms |
aa1cf14 | 420.06 ms | 475.65 ms | 55.58 ms |
42c03a5 | 375.61 ms | 435.12 ms | 59.51 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
691b9d3 | 1.72 MiB | 2.27 MiB | 562.86 KiB |
9a38f08 | 1.70 MiB | 2.27 MiB | 584.03 KiB |
aa1cf14 | 1.70 MiB | 2.27 MiB | 584.14 KiB |
42c03a5 | 1.72 MiB | 2.27 MiB | 562.90 KiB |
…profiling3-start-profiler # Conflicts: # sentry/src/main/java/io/sentry/Sentry.java
sentry-android-core/src/main/java/io/sentry/android/core/AndroidTransactionProfiler.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/SentryStartupProfilingProvider.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/SentryStartupProfilingProvider.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/SentryStartupProfilingProvider.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/SentryStartupProfilingProvider.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java
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.
some comments, but overall looks great, amazing stuff! Let's slim down that SentryInitProvider time
…method in IHub added synchronized blocks for startup profiling management added log for not sampled startup profile
@romtsn Want to have a last look before merging? i should have updated it with all your feedback |
sentry-android-core/src/main/java/io/sentry/android/core/SentryPerformanceProvider.java
Show resolved
Hide resolved
…in performance metrics
LGTM now, thanks for addressing! |
7d13d65
into
feat/startup-profiling2-add-options
* added TransactionContext.isForNextStartup * added SentryOptions.enableStartupProfiling * added SentryStartupProfilingOptions class with Json ser/deser * added startupProfilingConfigFile deletion and creation on init * added sampling decision on SDK init with isForNextStartup flag set to true * added SentryOptions.getCacheDirPathWithoutDsn for startupProfiling config file * Startup Profiling 3 - Add ContentProvider and start profile (#3128) * first activity transaction now inherits startup sampling decision, if available * if a startup profiler was instantiated, it will be reused in AndroidOptionsInitializer, instead of creating a new one * added ITransactionProfiler.isRunning * startup profiler and sampling decision is stored in AppStartMetrics * startup profile is bound to the startup transaction * added io.sentry.profiling.enable-startup manifest option * moved profilingTracesHz from SentryAndroidOptions to SentryOptions * added startup profiling launch in SentryPerformanceProvider * added isStartupTransaction to TransactionOptions
* Startup Profiling 1 - Decouple Profiler from Transaction (#3101) * removed the need of a transaction to start a profile in AndroidTransactionProfiler, allowing to bind one later * added a constructor to AndroidTransactionProfiler without options * added options as param to AndroidTransactionProfiler.onTransactionFinish * Startup Profiling 2 - Add options and sampling logic (#3121) * added TransactionContext.isForNextStartup * added SentryOptions.enableStartupProfiling * added SentryStartupProfilingOptions class with Json ser/deser * added startupProfilingConfigFile deletion and creation on init * added sampling decision on SDK init with isForNextStartup flag set to true * added SentryOptions.getCacheDirPathWithoutDsn for startupProfiling config file * Startup Profiling 3 - Add ContentProvider and start profile (#3128) * first activity transaction now inherits startup sampling decision, if available * if a startup profiler was instantiated, it will be reused in AndroidOptionsInitializer, instead of creating a new one * added ITransactionProfiler.isRunning * startup profiler and sampling decision is stored in AppStartMetrics * startup profile is bound to the startup transaction * added io.sentry.profiling.enable-startup manifest option * moved profilingTracesHz from SentryAndroidOptions to SentryOptions * added startup profiling launch in SentryPerformanceProvider * added isStartupTransaction to TransactionOptions
📜 Description
Added SentryStartupProfilingProvider, which reads the config file from disk, sample the trace and profile, and starts the profiler. Then it stores the startup profiler and sampling decision in AppStartMetrics:
Startup profile is bound to the startup transaction:
Added io.sentry.profiling.enable-startup manifest option (forgot to do it in previous PR)
Moved profilingTracesHz from SentryAndroidOptions to SentryOptions (needed to get access in
Sentry.init
to save profiling config to disk)Example profile: we can see the 98ms of our
SentryInitProvider
😅💡 Motivation and Context
This is the last PR to enable startup profiling
💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps
Docs