fix stats
This commit is contained in:
@@ -1070,3 +1070,38 @@ func Worker_nodes_plan(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(workerNodesPlan)
|
||||
}
|
||||
|
||||
func ClusterStats(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
data := models.ClusterStats{
|
||||
ResourceUsage: models.ResourceUsage{
|
||||
CPU: models.Usage{Used: 65, Total: 100, Unit: "cores"},
|
||||
Memory: models.Usage{Used: 8.2, Total: 16, Unit: "GB"},
|
||||
Storage: models.Usage{Used: 45, Total: 100, Unit: "GB"},
|
||||
Network: models.Usage{Used: 2.1, Total: 10, Unit: "Gbps"},
|
||||
},
|
||||
Performance: models.Performance{
|
||||
PodStartupTime: "2.3s",
|
||||
APILatency: "45ms",
|
||||
EtcdLatency: "12ms",
|
||||
SchedulerLatency: "8ms",
|
||||
},
|
||||
Health: models.Health{
|
||||
NodesHealthy: 3,
|
||||
NodesTotal: 3,
|
||||
PodsRunning: 10,
|
||||
PodsTotal: 12,
|
||||
Alerts: 2,
|
||||
Warnings: 1,
|
||||
},
|
||||
Uptime: models.Uptime{
|
||||
ClusterUptime: "15d 8h 32m",
|
||||
LastMaintenance: "3d ago",
|
||||
NextMaintenance: "11d from now",
|
||||
},
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(data)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user