@@ -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