MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / stopProfiler

Function stopProfiler

packages/core/src/profiling.ts:47–66  ·  view source on GitHub ↗

* Stops the Sentry continuous profiler. * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.

()

Source from the content-addressed store, hash-verified

45 * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
46 */
47function 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.

Callers

nothing calls this directly

Calls 5

getClientFunction · 0.90
warnMethod · 0.65
stopMethod · 0.65
getIntegrationByNameMethod · 0.45

Tested by

no test coverage detected