fix stats

This commit is contained in:
Ybehrooz
2025-08-31 19:35:41 +03:30
parent 06b7aaa548
commit b82db8e0b1
3 changed files with 79 additions and 1 deletions

View File

@@ -16,7 +16,7 @@ type Cluster struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
ControlPlane string `json:"controlPlane"`
PlatformVersion string `json:"platformversion`
PlatformVersion string `json:"platformversion"`
Cpu string `json:"cpu"`
Memory string `json:"memory"`
CreatedAt string `json:"createdAt"`
@@ -109,3 +109,45 @@ type WorkerNodesPlans struct {
Memory string `json:memory`
Storage string `;sjon:storage`
}
type ClusterStats struct {
ResourceUsage ResourceUsage `json:"resourceUsage"`
Performance Performance `json:"performance"`
Health Health `json:"health"`
Uptime Uptime `json:"uptime"`
}
type ResourceUsage struct {
CPU Usage `json:"cpu"`
Memory Usage `json:"memory"`
Storage Usage `json:"storage"`
Network Usage `json:"network"`
}
type Usage struct {
Used float64 `json:"used"`
Total float64 `json:"total"`
Unit string `json:"unit"`
}
type Performance struct {
PodStartupTime string `json:"podStartupTime"`
APILatency string `json:"apiLatency"`
EtcdLatency string `json:"etcdLatency"`
SchedulerLatency string `json:"schedulerLatency"`
}
type Health struct {
NodesHealthy int `json:"nodesHealthy"`
NodesTotal int `json:"nodesTotal"`
PodsRunning int `json:"podsRunning"`
PodsTotal int `json:"podsTotal"`
Alerts int `json:"alerts"`
Warnings int `json:"warnings"`
}
type Uptime struct {
ClusterUptime string `json:"clusterUptime"`
LastMaintenance string `json:"lastMaintenance"`
NextMaintenance string `json:"nextMaintenance"`
}