stats

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: LGPL-2.1 Imports: 3 Imported by: 0

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

View Source
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.

View Source
var DefaultChanSize = 100

DefaultChanSize is the default size of stats channels.

View Source
var DefaultInterval = time.Second * 10

DefaultInterval is the default interval used for sending stats.

View Source
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

func DrainStats(ctx context.Context)

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.

Jump to

Keyboard shortcuts

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