Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
Types ¶
type Counter ¶
Counter providers a threadsafe counter to use for storing long running counts
func NewCounter ¶
func NewCounter() Counter
NewCounter initializes a counter starting at time.Now() and a count of 0 and returns it
type MessageCountFn ¶
type MessageCountFn func() int
type MonitorAccumulation ¶
type MonitorAccumulation int
MonitorAccumulation controls how monitor data is accumulated over time into larger summary buckets
const ( // Cumulative values with sum over time Cumulative MonitorAccumulation = iota // Average values will average over time Average )
type MonitorHistory ¶
type MonitorHistory interface { Start() Stop() Minutes() []float64 Hours() []float64 Days() []float64 Weeks() []float64 Months() []float64 Report(w *bufio.Writer) }
MonitorHistory runs a monitor every minute and rotates and averages the results out across time
func NewMonitorHistory ¶
func NewMonitorHistory(t MonitorType, a MonitorAccumulation, monitor func() float64) MonitorHistory
NewMonitorHistory returns a new MonitorHistory with starttime of time.Now and Started running with supplied monitor
type MonitorType ¶
type MonitorType int
MonitorType controls how the monitor will report itself
const ( // Count indicates the monitor should report in interger format Count MonitorType = iota // Percent indicates the monitor should report in decimal format with 2 places Percent // MegaBytes indicates the monitor should transform the raw number into MBs MegaBytes )
type Monitors ¶
type Monitors struct { MessageCounter Counter Messages MonitorHistory Memory MonitorHistory ClientConns MonitorHistory // contains filtered or unexported fields }
Monitors is a package of metrics for a Cwtch Server including message count, CPU, Mem, and conns
Click to show internal directories.
Click to hide internal directories.