* Stops the Sentry continuous profiler. * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
()
| 45 | * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry. |
| 46 | */ |
| 47 | function stopProfiler(): void { |
| 48 | const client = getClient(); |
| 49 | if (!client) { |
| 50 | DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started'); |
| 51 | return; |
| 52 | } |
| 53 | |
| 54 | const integration = client.getIntegrationByName<ProfilingIntegration>('ProfilingIntegration'); |
| 55 | if (!integration) { |
| 56 | DEBUG_BUILD && debug.warn('ProfilingIntegration is not available'); |
| 57 | return; |
| 58 | } |
| 59 | |
| 60 | if (!isProfilingIntegrationWithProfiler(integration)) { |
| 61 | DEBUG_BUILD && debug.warn('Profiler is not available on profiling integration.'); |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | integration._profiler.stop(); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Profiler namespace for controlling the profiler in 'manual' mode. |
nothing calls this directly
no test coverage detected