Skip to content

Commit

Permalink
fix: fix player status
Browse files Browse the repository at this point in the history
  • Loading branch information
mika-f committed Aug 13, 2024
1 parent 969298c commit 6cb5cc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func (mc MinecraftPlugin) FetchMetrics() (map[string]float64, error) {
}

return map[string]float64{
"max_players": float64(status.MaxPlayers),
"online_players": float64(status.OnlinePlayers),
"max": float64(status.MaxPlayers),
"online": float64(status.OnlinePlayers),
"latency": float64(status.Latency),
"overworld.size": float64(data.Overworld.SizeInBytes),
"overworld.chunk.x_max": float64(data.Overworld.ChunkX.P * 32),
Expand All @@ -50,13 +50,13 @@ func (mc MinecraftPlugin) FetchMetrics() (map[string]float64, error) {
func (mc MinecraftPlugin) GraphDefinition() map[string]mp.Graphs {
prefix := mc.GetPrefix()

players := prefix + ".player"
player := prefix + ".player"
data := prefix + ".data"

return map[string]mp.Graphs{
players: {
player: {
Label: "Minecraft Server Status",
Unit: mp.UnitFloat,
Unit: mp.UnitInteger,
Metrics: []mp.Metrics{
{Name: "max", Label: "Limit"},
{Name: "online", Label: "Current Players"},
Expand Down

0 comments on commit 6cb5cc1

Please sign in to comment.