Skip to content

Commit

Permalink
update for continuous profiling (#11763)
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight authored Nov 20, 2024
1 parent de5dd36 commit 9e179d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ SentrySDK.start { options in
options.enableTimeToFullDisplayTracing = true
options.enableAppLaunchProfiling = true
options.swiftAsyncStacktraces = true
options.profilesSampleRate = nil // enable continuous profiling mode
}
```

Expand All @@ -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
}];
```
Expand Down
30 changes: 22 additions & 8 deletions docs/platforms/apple/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand All @@ -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;
}
```
Expand Down

0 comments on commit 9e179d4

Please sign in to comment.