Add comprehensive Claude Code monitoring and realtime streaming to the K8s dashboard. Includes API endpoints for health, stats, summary, inventory, and live event streaming. Frontend provides overview, usage, inventory, debug, and live feed views.
34 lines
1.2 KiB
Go
34 lines
1.2 KiB
Go
package claude
|
|
|
|
type DailyActivity struct {
|
|
Date string `json:"date"`
|
|
MessageCount int `json:"messageCount"`
|
|
SessionCount int `json:"sessionCount"`
|
|
ToolCallCount int `json:"toolCallCount"`
|
|
}
|
|
|
|
type DailyModelTokens struct {
|
|
Date string `json:"date"`
|
|
TokensByModel map[string]int `json:"tokensByModel"`
|
|
}
|
|
|
|
type ModelUsage struct {
|
|
InputTokens int `json:"inputTokens"`
|
|
OutputTokens int `json:"outputTokens"`
|
|
CacheReadInputTokens int `json:"cacheReadInputTokens"`
|
|
CacheCreationInputTokens int `json:"cacheCreationInputTokens"`
|
|
WebSearchRequests int `json:"webSearchRequests"`
|
|
CostUSD float64 `json:"costUSD"`
|
|
ContextWindow int `json:"contextWindow"`
|
|
}
|
|
|
|
type StatsCache struct {
|
|
Version int `json:"version"`
|
|
LastComputedDate string `json:"lastComputedDate"`
|
|
DailyActivity []DailyActivity `json:"dailyActivity"`
|
|
DailyModelTokens []DailyModelTokens `json:"dailyModelTokens"`
|
|
ModelUsage map[string]ModelUsage `json:"modelUsage"`
|
|
TotalSessions int `json:"totalSessions"`
|
|
TotalMessages int `json:"totalMessages"`
|
|
}
|