From 9e179d4bc7b20c73455d0d2701213fe15cf4d2c9 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 20 Nov 2024 13:56:47 -0900 Subject: [PATCH] update for continuous profiling (#11763) --- .../common/features/experimental-features.mdx | 2 -- docs/platforms/apple/common/index.mdx | 30 ++++++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/platforms/apple/common/features/experimental-features.mdx b/docs/platforms/apple/common/features/experimental-features.mdx index 6ee713e6dac55..2f0c827f11073 100644 --- a/docs/platforms/apple/common/features/experimental-features.mdx +++ b/docs/platforms/apple/common/features/experimental-features.mdx @@ -28,7 +28,6 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = true options.enableAppLaunchProfiling = true options.swiftAsyncStacktraces = true - options.profilesSampleRate = nil // enable continuous profiling mode } ``` @@ -42,7 +41,6 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = YES; options.enableAppLaunchProfiling = YES; options.swiftAsyncStacktraces = YES; // only applies to async code in Swift - options.profilesSampleRate = nil; // enable continuous profiling mode }]; ``` diff --git a/docs/platforms/apple/common/index.mdx b/docs/platforms/apple/common/index.mdx index 86dc7cfafb19b..8c357e9873029 100644 --- a/docs/platforms/apple/common/index.mdx +++ b/docs/platforms/apple/common/index.mdx @@ -86,12 +86,19 @@ func application(_ application: UIApplication, // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.tracesSampleRate = 1.0 - - // Sample rate for profiling, applied on top of TracesSampleRate. - // We recommend adjusting this value in production. - options.profilesSampleRate = 1.0 } + // Manually call startProfiler and stopProfiler to profile any code that runs in between. + SentrySDK.startProfiler() + + // + // ...anything here will be profiled... + // + + // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling + // your application until the process exits, the app goes to the background, or stopProfiling is called. + SentrySDK.stopProfiler() + return true } ``` @@ -108,12 +115,19 @@ func application(_ application: UIApplication, // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.tracesSampleRate = @1.0; - - // Sample rate for profiling, applied on top of TracesSampleRate. - // We recommend adjusting this value in production. - options.profilesSampleRate = @1.0; }]; + // Manually call startProfiler and stopProfiler to profile any code that runs in between. + [SentrySDK startProfiler]; + + // + // ...anything here will be profiled... + // + + // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling + // your application until the process exits, the app goes to the background, or stopProfiling is called. + [SentrySDK stopProfiler]; + return YES; } ```