Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
getSdkMetadataForEnvelopeHeader,
uuid4,
} from '@sentry/core';
import { DEBUG_BUILD } from '../../debug-build';
import type { JSSelfProfiler } from '../jsSelfProfiling';
import { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from '../utils';
import { DEBUG_BUILD } from './../debug-build';
import type { JSSelfProfiler } from './jsSelfProfiling';
import { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from './utils';

const CHUNK_INTERVAL_MS = 60_000; // 1 minute
// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)
Expand All @@ -27,7 +27,7 @@ const MAX_ROOT_SPAN_PROFILE_MS = 300_000; // 5 minutes
* - there are no more sampled root spans, or
* - the 60s chunk timer elapses while profiling is running.
*/
export class BrowserTraceLifecycleProfiler {
export class UIProfiler {
private _client: Client | undefined;
private _profiler: JSSelfProfiler | undefined;
private _chunkTimer: ReturnType<typeof setTimeout> | undefined;
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/profiling/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { debug, defineIntegration, getActiveSpan, getRootSpan, hasSpansEnabled }
import type { BrowserOptions } from '../client';
import { DEBUG_BUILD } from '../debug-build';
import { WINDOW } from '../helpers';
import { BrowserTraceLifecycleProfiler } from './lifecycleMode/traceLifecycleProfiler';
import { startProfileForSpan } from './startProfileForSpan';
import { UIProfiler } from './UIProfiler';
import type { ProfiledEvent } from './utils';
import {
addProfilesToEnvelope,
Expand Down Expand Up @@ -65,7 +65,7 @@ const _browserProfilingIntegration = (() => {
return;
}

const traceLifecycleProfiler = new BrowserTraceLifecycleProfiler();
const traceLifecycleProfiler = new UIProfiler();
traceLifecycleProfiler.initialize(client, sessionSampled);

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