diff --git a/cmd/server/routes.go b/cmd/server/routes.go index 7443144b..486d8c1e 100644 --- a/cmd/server/routes.go +++ b/cmd/server/routes.go @@ -495,11 +495,15 @@ func (s *Server) handlePerf(w http.ResponseWriter, r *http.Request) { GoRuntime: func() *GoRuntimeStats { ms := s.getMemStats() return &GoRuntimeStats{ - HeapMB: float64(ms.HeapAlloc) / 1024 / 1024, - SysMB: float64(ms.Sys) / 1024 / 1024, - NumGoroutine: runtime.NumGoroutine(), + Goroutines: runtime.NumGoroutine(), NumGC: ms.NumGC, - GCPauseMs: float64(ms.PauseNs[(ms.NumGC+255)%256]) / 1e6, + PauseTotalMs: float64(ms.PauseTotalNs) / 1e6, + LastPauseMs: float64(ms.PauseNs[(ms.NumGC+255)%256]) / 1e6, + HeapAllocMB: float64(ms.HeapAlloc) / 1024 / 1024, + HeapSysMB: float64(ms.HeapSys) / 1024 / 1024, + HeapInuseMB: float64(ms.HeapInuse) / 1024 / 1024, + HeapIdleMB: float64(ms.HeapIdle) / 1024 / 1024, + NumCPU: runtime.NumCPU(), } }(), }) diff --git a/cmd/server/types.go b/cmd/server/types.go index 0edac5e6..176f21e4 100644 --- a/cmd/server/types.go +++ b/cmd/server/types.go @@ -211,11 +211,15 @@ type PerfResponse struct { // GoRuntimeStats holds Go runtime metrics for the perf endpoint. type GoRuntimeStats struct { - HeapMB float64 `json:"heapMB"` - SysMB float64 `json:"sysMB"` - NumGoroutine int `json:"numGoroutine"` + Goroutines int `json:"goroutines"` NumGC uint32 `json:"numGC"` - GCPauseMs float64 `json:"gcPauseMs"` + PauseTotalMs float64 `json:"pauseTotalMs"` + LastPauseMs float64 `json:"lastPauseMs"` + HeapAllocMB float64 `json:"heapAllocMB"` + HeapSysMB float64 `json:"heapSysMB"` + HeapInuseMB float64 `json:"heapInuseMB"` + HeapIdleMB float64 `json:"heapIdleMB"` + NumCPU int `json:"numCPU"` } // ─── Packets ───────────────────────────────────────────────────────────────────