Skip to content

Commit 2deb000

Browse files
authored
ref(browserprofiling): Move and rename profiler class to UIProfiler (#18187)
This PR renames and moves the profiler class as the class will be used for the `trace` and `manual` lifecycle in the future (prevents large git diffs). Part of #17279
1 parent 4f71c94 commit 2deb000

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import {
99
getSdkMetadataForEnvelopeHeader,
1010
uuid4,
1111
} from '@sentry/core';
12-
import { DEBUG_BUILD } from '../../debug-build';
13-
import type { JSSelfProfiler } from '../jsSelfProfiling';
14-
import { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from '../utils';
12+
import { DEBUG_BUILD } from './../debug-build';
13+
import type { JSSelfProfiler } from './jsSelfProfiling';
14+
import { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from './utils';
1515

1616
const CHUNK_INTERVAL_MS = 60_000; // 1 minute
1717
// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)
@@ -27,7 +27,7 @@ const MAX_ROOT_SPAN_PROFILE_MS = 300_000; // 5 minutes
2727
* - there are no more sampled root spans, or
2828
* - the 60s chunk timer elapses while profiling is running.
2929
*/
30-
export class BrowserTraceLifecycleProfiler {
30+
export class UIProfiler {
3131
private _client: Client | undefined;
3232
private _profiler: JSSelfProfiler | undefined;
3333
private _chunkTimer: ReturnType<typeof setTimeout> | undefined;

packages/browser/src/profiling/integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { debug, defineIntegration, getActiveSpan, getRootSpan, hasSpansEnabled }
33
import type { BrowserOptions } from '../client';
44
import { DEBUG_BUILD } from '../debug-build';
55
import { WINDOW } from '../helpers';
6-
import { BrowserTraceLifecycleProfiler } from './lifecycleMode/traceLifecycleProfiler';
76
import { startProfileForSpan } from './startProfileForSpan';
7+
import { UIProfiler } from './UIProfiler';
88
import type { ProfiledEvent } from './utils';
99
import {
1010
addProfilesToEnvelope,
@@ -65,7 +65,7 @@ const _browserProfilingIntegration = (() => {
6565
return;
6666
}
6767

68-
const traceLifecycleProfiler = new BrowserTraceLifecycleProfiler();
68+
const traceLifecycleProfiler = new UIProfiler();
6969
traceLifecycleProfiler.initialize(client, sessionSampled);
7070

7171
// If there is an active, sampled root span already, notify the profiler

0 commit comments

Comments
 (0)