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

Method start

packages/browser/src/profiling/UIProfiler.ts:96–116  ·  view source on GitHub ↗

Starts UI profiling (only effective in 'manual' mode and when sampled).

()

Source from the content-addressed store, hash-verified

94
95 /** Starts UI profiling (only effective in 'manual' mode and when sampled). */
96 public start(): void {
97 if (this._lifecycleMode === 'trace') {
98 DEBUG_BUILD &&
99 debug.warn(
100 '[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.',
101 );
102 return;
103 }
104
105 if (this._isRunning) {
106 DEBUG_BUILD && debug.warn('[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.');
107 return;
108 }
109
110 if (!this._sessionSampled) {
111 DEBUG_BUILD && debug.warn('[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.');
112 return;
113 }
114
115 this._beginProfiling();
116 }
117
118 /** Stops UI profiling (only effective in 'manual' mode). */
119 public stop(): void {

Callers 1

setupFunction · 0.95

Calls 2

_beginProfilingMethod · 0.95
warnMethod · 0.65

Tested by

no test coverage detected