Skip to content

Commit a413ff8

Browse files
committed
test(e2e): Add sentry-sdk-init measure and marks
1 parent 0c8e82a commit a413ff8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • dev-packages/e2e-tests/test-applications/lighthouse-react/src

dev-packages/e2e-tests/test-applications/lighthouse-react/src/main.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import * as Sentry from '@sentry/react';
22
import { createRoot } from 'react-dom/client';
33
import App from './App';
44

5+
const sentryInitStart = performance.now();
6+
performance.mark('sentry-sdk-init-start', {
7+
detail: { mode: import.meta.env.MODE ?? 'unknown_mode' },
8+
});
9+
510
if (import.meta.env.MODE === 'tracing-replay') {
611
Sentry.init({
712
dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined,
@@ -33,6 +38,16 @@ if (import.meta.env.MODE === 'tracing-replay') {
3338
// no DSN warning). We're measuring pure SDK-loading + tree-shaking cost.
3439
Sentry.init({ enabled: false });
3540
}
41+
42+
performance.measure('sentry-sdk-init-duration', {
43+
detail: { mode: import.meta.env.MODE ?? 'unknown_mode' },
44+
start: sentryInitStart,
45+
end: performance.now(),
46+
});
47+
performance.mark('sentry-sdk-init-end', {
48+
detail: { mode: import.meta.env.MODE ?? 'unknown_mode' },
49+
});
50+
3651
// 'no-sentry' mode: all branches above are statically dead, so Vite drops
3752
// the @sentry/react import entirely from the bundle.
3853

0 commit comments

Comments
 (0)