(now: number)
| 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); |