Add stat card sparkline graphs with timeseries backend endpoint
New /search/stats/timeseries endpoint returns bucketed counts/metrics over a time window using ClickHouse toStartOfInterval(). Frontend Sparkline component renders SVG polyline + gradient fill on each stat card, driven by a useStatsTimeseries query hook. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
31
ui/src/api/schema.d.ts
vendored
31
ui/src/api/schema.d.ts
vendored
@@ -106,6 +106,24 @@ export interface paths {
|
||||
};
|
||||
};
|
||||
};
|
||||
'/search/stats/timeseries': {
|
||||
get: {
|
||||
parameters: {
|
||||
query: {
|
||||
from: string;
|
||||
to?: string;
|
||||
buckets?: number;
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
200: {
|
||||
content: {
|
||||
'application/json': StatsTimeseries;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
'/agents': {
|
||||
get: {
|
||||
parameters: {
|
||||
@@ -197,6 +215,19 @@ export interface ExecutionStats {
|
||||
activeCount: number;
|
||||
}
|
||||
|
||||
export interface StatsTimeseries {
|
||||
buckets: TimeseriesBucket[];
|
||||
}
|
||||
|
||||
export interface TimeseriesBucket {
|
||||
time: string;
|
||||
totalCount: number;
|
||||
failedCount: number;
|
||||
avgDurationMs: number;
|
||||
p99DurationMs: number;
|
||||
activeCount: number;
|
||||
}
|
||||
|
||||
export interface AgentInstance {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user