-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathsubject.js
More file actions
26 lines (21 loc) · 734 Bytes
/
subject.js
File metadata and controls
26 lines (21 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as Sentry from '@sentry/browser';
import { browserProfilingIntegration } from '@sentry/browser';
window.Sentry = Sentry;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [browserProfilingIntegration()],
tracesSampleRate: 1,
profilesSampleRate: 1,
});
function fibonacci(n) {
if (n <= 1) {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
await Sentry.startSpanManual({ name: 'root-fibonacci-2', parentSpan: null, forceTransaction: true }, async span => {
fibonacci(30);
// Timeout to prevent flaky tests. Integration samples every 20ms, if function is too fast it might not get sampled
await new Promise(resolve => setTimeout(resolve, 21));
span.end();
});