fix: use raw timestamp string for throughput/error chart data
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m22s
CI / docker (push) Successful in 1m10s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 56s

Avoids Date round-trip that crashes with toISOString() on invalid
timestamps from the timeseries API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-12 21:25:00 +02:00
parent 65ed94f0e0
commit ce8a2a1525

View File

@@ -80,7 +80,7 @@ export default function AgentInstance() {
? (new Date(buckets[1].timestamp).getTime() - new Date(buckets[0].timestamp).getTime()) / 1000
: 60;
return buckets.map((b: any) => ({
date: new Date(b.timestamp),
time: b.timestamp,
throughput: bucketSecs > 0 ? b.totalCount / bucketSecs : b.totalCount,
latency: b.avgDurationMs,
errorPct: b.totalCount > 0 ? (b.failedCount / b.totalCount) * 100 : 0,
@@ -129,12 +129,12 @@ export default function AgentInstance() {
const throughputData = useMemo(() => {
if (!chartData.length) return [];
return chartData.map((d: any) => ({ time: d.date.toISOString(), throughput: d.throughput }));
return chartData.map((d: any) => ({ time: d.time, throughput: d.throughput }));
}, [chartData]);
const errorData = useMemo(() => {
if (!chartData.length) return [];
return chartData.map((d: any) => ({ time: d.date.toISOString(), errorPct: d.errorPct }));
return chartData.map((d: any) => ({ time: d.time, errorPct: d.errorPct }));
}, [chartData]);
// Application logs