MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / _cleanup

Function _cleanup

packages/replay-internal/src/util/throttle.ts:20–27  ·  view source on GitHub ↗
(now: number)

Source from the content-addressed store, hash-verified

18 const counter = new Map<number, number>();
19
20 const _cleanup = (now: number): void => {
21 const threshold = now - durationSeconds;
22 counter.forEach((_value, key) => {
23 if (key < threshold) {
24 counter.delete(key);
25 }
26 });
27 };
28
29 const _getTotalCount = (): number => {
30 return [...counter.values()].reduce((a, b) => a + b, 0);

Callers 1

throttleFunction · 0.85

Calls 2

forEachMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected