-
-
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 new APIs for Continuous Profiling v8 (p5) #3844
Add new APIs for Continuous Profiling v8 (p5) #3844
Conversation
added Sentry.startProfile() API removed profilesSampleRate from sample app to enable continuous profiling
|
Performance metrics 🚀
|
@@ -1022,6 +1022,16 @@ public static void endSession() { | |||
return getCurrentScopes().startTransaction(transactionContext, transactionOptions); | |||
} | |||
|
|||
/** Starts the continuous profiler, if enabled. */ | |||
public static void startProfiler() { |
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.
wdyt of introducing a subclass (like a namespace) Sentry.profiling().start()
akin to Sentry.metrics()
? We're also gonna do that for replay soon
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.
We want to keep the SDKs aligned. Other SDKs, like cocoa, is doing SentrySDK.startProfiler
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Show resolved
Hide resolved
…rofiling-part5 # Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java # sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml # sentry/api/sentry.api # sentry/src/main/java/io/sentry/HubScopesWrapper.java # sentry/src/main/java/io/sentry/NoOpHub.java # sentry/src/main/java/io/sentry/NoOpScopes.java # sentry/src/main/java/io/sentry/Scopes.java # sentry/src/main/java/io/sentry/ScopesAdapter.java
* create app start continuous profiler instead of transaction profiler, based on config * updated SentryAppStartProfilingOptions with isContinuousProfilingEnabled flag * updated SentryOptions with isContinuousProfilingEnabled() method * cut profiler setup out in a specific function to improve readability of AndroidOptionsInitializer Add new APIs for Continuous Profiling v8 (p5) (#3844) * AndroidContinuousProfiler now retrieve the scopes on start() * removed profilesSampleRate from sample app to enable continuous profiling * added Sentry.startProfiler and Sentry.stopProfiler APIs
* added profile context to SentryTracer * removed isProfilingEnabled from AndroidContinuousProfiler, as it's useless * added continuous profiler to SentryOptions * added DefaultTransactionPerformanceCollector to AndroidContinuousProfiler * updated DefaultTransactionPerformanceCollector to work with string ids other than transactions * fixed ProfileChunk measurements being modifiable from other code * added thread id and name to SpanContext.data * added profiler_id to span data * close continuous profiler on scopes close * renamed TransactionPerformanceCollector to CompositePerformanceCollector * added SpanContext.data ser/deser Handle App Start Continuous Profiling v8 (p4) (#3730) * create app start continuous profiler instead of transaction profiler, based on config * updated SentryAppStartProfilingOptions with isContinuousProfilingEnabled flag * updated SentryOptions with isContinuousProfilingEnabled() method * cut profiler setup out in a specific function to improve readability of AndroidOptionsInitializer Add new APIs for Continuous Profiling v8 (p5) (#3844) * AndroidContinuousProfiler now retrieve the scopes on start() * removed profilesSampleRate from sample app to enable continuous profiling * added Sentry.startProfiler and Sentry.stopProfiler APIs
* added profile_chunk envelope create * added IHub.captureProfileChunk and ISentryClient.captureProfileChunk * added profilerId and chunkId reset logic to AndroidContinuousProfiler * added absolute timestamps to ProfileMeasurementValue * added ProfileContext to Contexts * removed timestampMillis from MemoryCollectionData and CpuCollectionData, now it uses timestamp.nanotime() to achieve same result * continuous profiler doesn't stop anymore when an error occurs, but continue scheduling restart Instantiate continuous profiling v8 (p3) (#3725) * added profile context to SentryTracer * removed isProfilingEnabled from AndroidContinuousProfiler, as it's useless * added continuous profiler to SentryOptions * added DefaultTransactionPerformanceCollector to AndroidContinuousProfiler * updated DefaultTransactionPerformanceCollector to work with string ids other than transactions * fixed ProfileChunk measurements being modifiable from other code * added thread id and name to SpanContext.data * added profiler_id to span data * close continuous profiler on scopes close * renamed TransactionPerformanceCollector to CompositePerformanceCollector * added SpanContext.data ser/deser Handle App Start Continuous Profiling v8 (p4) (#3730) * create app start continuous profiler instead of transaction profiler, based on config * updated SentryAppStartProfilingOptions with isContinuousProfilingEnabled flag * updated SentryOptions with isContinuousProfilingEnabled() method * cut profiler setup out in a specific function to improve readability of AndroidOptionsInitializer Add new APIs for Continuous Profiling v8 (p5) (#3844) * AndroidContinuousProfiler now retrieve the scopes on start() * removed profilesSampleRate from sample app to enable continuous profiling * added Sentry.startProfiler and Sentry.stopProfiler APIs
📜 Description
added Sentry.startProfiler and Sentry.stopProfiler APIs
AndroidContinuousProfiler now checks the scopes (and options) on profile start
#skip-changelog
💡 Motivation and Context
Implements user APIs for Continuous Profiling
Part 5 of #3710
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps