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

Function startProfiler

packages/browser/src/profiling/index.ts:10–25  ·  view source on GitHub ↗

* Starts the Sentry UI profiler. * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value. * In UI profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling

()

Source from the content-addressed store, hash-verified

8 * In UI profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.
9 */
10function startProfiler(): void {
11 const client = getClient();
12 if (!client) {
13 DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');
14 return;
15 }
16
17 const integration = client.getIntegrationByName('BrowserProfiling');
18
19 if (!integration) {
20 DEBUG_BUILD && debug.warn('BrowserProfiling integration is not available');
21 return;
22 }
23
24 client.emit('startUIProfiler');
25}
26
27/**
28 * Stops the Sentry UI profiler.

Callers

nothing calls this directly

Calls 4

getClientFunction · 0.90
warnMethod · 0.65
emitMethod · 0.65
getIntegrationByNameMethod · 0.45

Tested by

no test coverage detected