MCPcopy Index your code
hub / github.com/cameri/nostream / getRatePerSecond

Function getRatePerSecond

src/scripts/export-events.ts:68–76  ·  view source on GitHub ↗
(value: number, elapsedMs: number)

Source from the content-addressed store, hash-verified

66}
67
68export const getRatePerSecond = (value: number, elapsedMs: number): number => {
69 if (!Number.isFinite(value) || value <= 0) {
70 return 0
71 }
72
73 const elapsedSeconds = Math.max(elapsedMs / 1000, MIN_ELAPSED_SECONDS)
74
75 return value / elapsedSeconds
76}
77
78const formatCount = (value: number): string => {
79 const rounded = Math.round(value * 100) / 100

Callers 2

runExportEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected