Skip to content

Commit 9e179d4

Browse files
authored
update for continuous profiling (#11763)
1 parent de5dd36 commit 9e179d4

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

docs/platforms/apple/common/features/experimental-features.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ SentrySDK.start { options in
2828
options.enableTimeToFullDisplayTracing = true
2929
options.enableAppLaunchProfiling = true
3030
options.swiftAsyncStacktraces = true
31-
options.profilesSampleRate = nil // enable continuous profiling mode
3231
}
3332
```
3433

@@ -42,7 +41,6 @@ SentrySDK.start { options in
4241
options.enableTimeToFullDisplayTracing = YES;
4342
options.enableAppLaunchProfiling = YES;
4443
options.swiftAsyncStacktraces = YES; // only applies to async code in Swift
45-
options.profilesSampleRate = nil; // enable continuous profiling mode
4644
}];
4745
```
4846

docs/platforms/apple/common/index.mdx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,19 @@ func application(_ application: UIApplication,
8686
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
8787
// We recommend adjusting this value in production.
8888
options.tracesSampleRate = 1.0
89-
90-
// Sample rate for profiling, applied on top of TracesSampleRate.
91-
// We recommend adjusting this value in production.
92-
options.profilesSampleRate = 1.0
9389
}
9490

91+
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
92+
SentrySDK.startProfiler()
93+
94+
//
95+
// ...anything here will be profiled...
96+
//
97+
98+
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
99+
// your application until the process exits, the app goes to the background, or stopProfiling is called.
100+
SentrySDK.stopProfiler()
101+
95102
return true
96103
}
97104
```
@@ -108,12 +115,19 @@ func application(_ application: UIApplication,
108115
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
109116
// We recommend adjusting this value in production.
110117
options.tracesSampleRate = @1.0;
111-
112-
// Sample rate for profiling, applied on top of TracesSampleRate.
113-
// We recommend adjusting this value in production.
114-
options.profilesSampleRate = @1.0;
115118
}];
116119

120+
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
121+
[SentrySDK startProfiler];
122+
123+
//
124+
// ...anything here will be profiled...
125+
//
126+
127+
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
128+
// your application until the process exits, the app goes to the background, or stopProfiling is called.
129+
[SentrySDK stopProfiler];
130+
117131
return YES;
118132
}
119133
```

0 commit comments

Comments
 (0)