From e057a6553553a990224ec2282767487b2d579dd2 Mon Sep 17 00:00:00 2001 From: M1 Date: Wed, 18 Mar 2026 16:31:08 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20avgLatency=20NaN=20=E2=80=94=20extract?= =?UTF-8?q?=20.latency=5Fms=20from=20ping=20objects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/views/home.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/views/home.ejs b/apps/web/src/views/home.ejs index 2266ec9..a73842e 100644 --- a/apps/web/src/views/home.ejs +++ b/apps/web/src/views/home.ejs @@ -25,7 +25,8 @@ <% } else { %> <% it.monitors.forEach(function(m) { const latencies = (m.pings || []).filter(p => p.latency_ms != null); - const avgLatency = latencies.length ? Math.round(latencies.reduce((a, b) => a + b, 0) / latencies.length) : null; + const latencyVals = latencies.map(p => p.latency_ms); + const avgLatency = latencyVals.length ? Math.round(latencyVals.reduce((a, b) => a + b, 0) / latencyVals.length) : null; %>