diff options
Diffstat (limited to 'pkg/api')
-rw-r--r-- | pkg/api/api0/serverlist.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/api/api0/serverlist.go b/pkg/api/api0/serverlist.go index fc9b019..e486792 100644 --- a/pkg/api/api0/serverlist.go +++ b/pkg/api/api0/serverlist.go @@ -395,7 +395,7 @@ func (s *ServerList) GetMetrics() []byte { mpls = append(mpls, mpl{m, nstypes.Playlist("")}) } - var players, maxPlayers, servers, serversWithPlayers int + var players, maxPlayers, servers, serversWithPlayers, fullServers int mplPlayers := make(map[mpl]int, len(mpls)) mplMaxPlayers := make(map[mpl]int, len(mpls)) mplServers := make(map[mpl]int, len(mpls)) @@ -419,6 +419,9 @@ func (s *ServerList) GetMetrics() []byte { if srv.PlayerCount > 0 { serversWithPlayers++ } + if srv.PlayerCount == srv.MaxPlayers { + fullServers++ + } mplPlayers[mplv] += srv.PlayerCount mplMaxPlayers[mplv] += srv.MaxPlayers mplServers[mplv]++ @@ -575,6 +578,9 @@ func (s *ServerList) GetMetrics() []byte { b.WriteString(`atlas_api0sl_serverswithplayers `) b.WriteString(strconv.Itoa(serversWithPlayers)) b.WriteByte('\n') + b.WriteString(`atlas_api0sl_fullservers `) + b.WriteString(strconv.Itoa(fullServers)) + b.WriteByte('\n') return b.Bytes() } |