From e4dff0cad181fb2279950521bd2790dc32a0dde4 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Mon, 23 Mar 2026 21:55:29 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20align=20RoutesMetrics=20with=20mock=20?= =?UTF-8?q?=E2=80=94=20chart=20titles,=20Invalid=20Date=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix Invalid Date in Errors bar chart (guard against null timestamps) - Table header: "Route Metrics" → "Per-Route Performance" - Chart titles: add units — "Throughput (msg/s)", "Latency (ms)", "Errors by Route", "Message Volume (msg/min)" - Add yLabel to charts for axis labels Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/pages/Routes/RoutesMetrics.tsx | 35 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/ui/src/pages/Routes/RoutesMetrics.tsx b/ui/src/pages/Routes/RoutesMetrics.tsx index a11794ae..6aa568a1 100644 --- a/ui/src/pages/Routes/RoutesMetrics.tsx +++ b/ui/src/pages/Routes/RoutesMetrics.tsx @@ -47,13 +47,19 @@ export default function RoutesMetrics() { ); const chartData = useMemo(() => - (timeseries?.buckets || []).map((b: any) => ({ - time: new Date(b.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }), - throughput: b.totalCount, - latency: b.avgDurationMs, - errors: b.failedCount, - successRate: b.totalCount > 0 ? ((b.totalCount - b.failedCount) / b.totalCount) * 100 : 100, - })), + (timeseries?.buckets || []).map((b: any, i: number) => { + const ts = b.timestamp ? new Date(b.timestamp) : null; + const time = ts && !isNaN(ts.getTime()) + ? ts.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + : String(i); + return { + time, + throughput: b.totalCount ?? 0, + latency: b.avgDurationMs ?? 0, + errors: b.failedCount ?? 0, + successRate: b.totalCount > 0 ? ((b.totalCount - b.failedCount) / b.totalCount) * 100 : 100, + }; + }), [timeseries], ); @@ -163,7 +169,7 @@ export default function RoutesMetrics() {
- Route Metrics + Per-Route Performance {rows.length} routes
0 && (
-
Throughput
- ({ x: i, y: d.throughput })) }]} height={200} /> +
Throughput (msg/s)
+ ({ x: i, y: d.throughput })) }]} yLabel="msg/s" height={200} />
-
Latency
+
Latency (ms)
({ x: i, y: d.latency })) }]} + yLabel="ms" height={200} threshold={{ value: 300, label: 'SLA 300ms' }} />
-
Errors
+
Errors by Route
({ x: d.time as string, y: d.errors })) }]} height={200} />
-
Success Rate
- ({ x: i, y: d.successRate })) }]} height={200} /> +
Message Volume (msg/min)
+ ({ x: i, y: d.throughput })) }]} yLabel="msg/min" height={200} />
)}