MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / freshClientStreams

Function freshClientStreams

scripts/check-stream-reliability.mjs:34–42  ·  view source on GitHub ↗
(metrics, nowMs)

Source from the content-addressed store, hash-verified

32}
33
34function 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
44function numeric(value) {
45 return typeof value === "number" && Number.isFinite(value) ? value : 0;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected