Documentation
¶
Overview ¶
stats supports Skogul by adding internal statistics
The stats are very generic and are sent as regular `skogul.Metric`s. By configuring the stats receiver all stats will be picked up and sent through skogul as any other metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Chan chan *skogul.Metric
Chan is a channel which accepts skogul statistic as a skogul.Metric By configuring the stats receiver, this channel is drained and sent on to the specified handler.
var DefaultChanSize = 100
DefaultChanSize is the default size of stats channels.
var DefaultInterval = time.Second * 10
DefaultInterval is the default interval used for sending stats.
var DrainCtx, CancelDrain = context.WithCancel(context.Background())
DrainCtx and CancelDrain are the context and cancel functions for the automatically created stats.Chan. If a skogul stats receiver is configured, DrainCancel MUST be called so that statistics are not discarded.
Functions ¶
func Collect ¶ added in v0.13.0
func Collect(m interface{})
Collect stats for a skogul.Module if it has stats. If it doesn't have stats it does nothing.
func DrainStats ¶
DrainStats drains all statistics on the stats channel. If the passed context is cancelled it will stop draining the channel so that a configured stats-receiver can listen on the channel.
Types ¶
This section is empty.