stats

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2017 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Overview

Package stats implements periodic collection and display of various - possibly interesting - statistics. A typical reading might be:

U[   1Mb  -816b ] O[          1564        +0] G[    39     +0] P 11/11

This shows:

U[   1Mb  -816b ] - used memory, change since last collection
O[  1564      +0] - heap objects, change since last collection
G[    39      +0] - Goroutines, change since last collection
P 11/11           - Current number of players / maximum number of players

Used memory is rounded to the nearest convenient units: b - bytes, kb - kilobytes, Mb - megabytes, Gb - gigabytes, Tb - terabytes, Pb - petabytes, Eb - exabytes. Everything above terabytes is included for completeness - but 64 unsigned bits *CAN* go up to 15Eb or 18,446,744,073,709,551,615 bytes ;)

The used memory only respresents allocated memory - not memory requested from the operating system which is going to be of a larger amount.

The calculations for memory usage have gone through several iterations. The current values correspond to the scavenger values for consumed memory seen when the server is run with GODEBUG=gctrace=1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(player has.Thing)

Add adds the specified player to the list of players.

func Find

func Find(player has.Thing) (found bool)

func Len

func Len() (l int)

Len returns the length of the player list.

func List

func List(omit has.Thing) []string

List returns the names of all players in the player list. The omit parameter may be used to specify a player that should be omitted from the list.

func Remove

func Remove(player has.Thing)

Remove removes the specified player from the list of players.

func Start

func Start()

Start begins collection and reporting of statistics. The interval between updates is controlled via config.StatsRate which if set to zero disables collection and reporting.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL