* Starts the Sentry continuous profiler. * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value. * In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for cont
()
| 19 | * In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application. |
| 20 | */ |
| 21 | function startProfiler(): void { |
| 22 | const client = getClient(); |
| 23 | if (!client) { |
| 24 | DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started'); |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration'); |
| 29 | |
| 30 | if (!integration) { |
| 31 | DEBUG_BUILD && debug.warn('ProfilingIntegration is not available'); |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | if (!isProfilingIntegrationWithProfiler(integration)) { |
| 36 | DEBUG_BUILD && debug.warn('Profiler is not available on profiling integration.'); |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | integration._profiler.start(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Stops the Sentry continuous profiler. |
nothing calls this directly
no test coverage detected