removed the extra stats table

This commit is contained in:
2025-01-17 00:20:38 +09:00
parent 369a41eeb2
commit 9118acb268
2 changed files with 1 additions and 18 deletions

View File

@ -34,8 +34,6 @@ type json_out_server_stats struct {
ServerPeers int64 `json:"server-peers"`
SshProxySessions int64 `json:"ssh-proxy-session"`
Extra map[string]int64 `json:"extra"`
}
// ------------------------------------
@ -359,8 +357,7 @@ func (ctl *server_ctl_stats) ServeHTTP(w http.ResponseWriter, req *http.Request)
case http.MethodGet:
var stats json_out_server_stats
var mstat runtime.MemStats
var k string
var v int64
runtime.ReadMemStats(&mstat)
stats.CPUs = runtime.NumCPU()
stats.Goroutines = runtime.NumGoroutine()
@ -372,10 +369,6 @@ func (ctl *server_ctl_stats) ServeHTTP(w http.ResponseWriter, req *http.Request)
stats.ServerRoutes = s.stats.routes.Load()
stats.ServerPeers = s.stats.peers.Load()
stats.SshProxySessions = s.stats.ssh_proxy_sessions.Load()
s.stats.extra_mtx.Lock()
stats.Extra = make(map[string]int64, len(s.stats.extra))
for k, v = range s.stats.extra { stats.Extra[k] = v }
s.stats.extra_mtx.Unlock()
status_code = WriteJsonRespHeader(w, http.StatusOK)
if err = je.Encode(stats); err != nil { goto oops }