(metrics, nowMs)
| 32 | } |
| 33 | |
| 34 | function freshClientStreams(metrics, nowMs) { |
| 35 | return (metrics.client_streams ?? []).filter((stream) => { |
| 36 | const timestampMs = Number(stream.timestampMs ?? 0); |
| 37 | if (timestampMs <= 0 || nowMs - timestampMs > 5000) { |
| 38 | return false; |
| 39 | } |
| 40 | return stream.status === "streaming" || stream.status === "connected"; |
| 41 | }); |
| 42 | } |
| 43 | |
| 44 | function numeric(value) { |
| 45 | return typeof value === "number" && Number.isFinite(value) ? value : 0; |
no outgoing calls
no test coverage detected