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

Function startProfiler

packages/core/src/profiling.ts:21–41  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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 */
21function 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.

Callers

nothing calls this directly

Calls 5

getClientFunction · 0.90
warnMethod · 0.65
startMethod · 0.65
getIntegrationByNameMethod · 0.45

Tested by

no test coverage detected