feat: add CPU usage to agent response and compact cards

Backend:
- Add cpuUsage field to AgentInstanceResponse (-1 if unavailable)
- Add queryAgentCpuUsage() to AgentRegistrationController — queries
  avg CPU per instance from agent_metrics over last 2 minutes
- Wire CPU into agent list response via withCpuUsage()

Frontend:
- Add cpuUsage to schema.d.ts
- Compute maxCpu per AppGroup (max across all instances)
- Show "X% cpu" on compact cards when available (hidden when -1)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-16 14:12:23 +02:00
parent b57fe875f3
commit 4b264b3308
5 changed files with 54 additions and 4 deletions

View File

@@ -2065,6 +2065,8 @@ export interface components {
totalRoutes: number;
/** Format: int64 */
uptimeSeconds: number;
/** Format: double */
cpuUsage: number;
};
SseEmitter: {
/** Format: int64 */