go-serverapi/tps.go

15 lines
336 B
Go

package serverapi
import "fmt"
// TPS is a Minecraft server's relative performance
type TPS struct {
Average float64 `json:"average"`
History []float64 `json:"history"`
}
// TPS returns TPS from a ServerAPI instance
func (c *Client) TPS() (tps *TPS, err error) {
return tps, c.jsonGET(fmt.Sprintf("%s/tps", c.endpoint), &tps)
}