fix: use raw timestamp string for throughput/error chart data
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user