Skip to content

Commit da8ba8d

Browse files
authored
profiling: bump chunk interval to 60s (#15361)
Bump profiling chunk interval to 60s as per [spec](https://www.notion.so/sentry/Continuous-UI-Profiling-SDK-API-Spec-17e8b10e4b5d80c59a40c6e114470934)
1 parent 136370c commit da8ba8d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/profiling-node/src/integration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
makeProfileChunkEnvelope,
3131
} from './utils';
3232

33-
const CHUNK_INTERVAL_MS = 5000;
33+
const CHUNK_INTERVAL_MS = 1000 * 60;
3434
const PROFILE_MAP = new LRUMap<string, RawThreadCpuProfile>(50);
3535
const PROFILE_TIMEOUTS: Record<string, NodeJS.Timeout> = {};
3636

packages/profiling-node/test/spanProfileUtils.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ describe('continuous profiling', () => {
501501
expect(startProfilingSpy).not.toHaveBeenCalledTimes(1);
502502
Sentry.profiler.startProfiler();
503503

504-
jest.advanceTimersByTime(5001);
504+
jest.advanceTimersByTime(60_001);
505505
expect(stopProfilingSpy).toHaveBeenCalledTimes(1);
506506
expect(startProfilingSpy).toHaveBeenCalledTimes(2);
507507
});
@@ -518,7 +518,7 @@ describe('continuous profiling', () => {
518518
Sentry.profiler.startProfiler();
519519
const profilerId = getProfilerId();
520520

521-
jest.advanceTimersByTime(5001);
521+
jest.advanceTimersByTime(60_001);
522522
expect(stopProfilingSpy).toHaveBeenCalledTimes(1);
523523
expect(startProfilingSpy).toHaveBeenCalledTimes(2);
524524
expect(getProfilerId()).toBe(profilerId);
@@ -552,7 +552,7 @@ describe('continuous profiling', () => {
552552
expect(startProfilingSpy).not.toHaveBeenCalledTimes(1);
553553
Sentry.profiler.startProfiler();
554554

555-
jest.advanceTimersByTime(5001);
555+
jest.advanceTimersByTime(60_001);
556556
expect(stopProfilingSpy).toHaveBeenCalledTimes(1);
557557
});
558558

0 commit comments

Comments
 (0)