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} />
)}