state

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct{}

Log struct is State interface implementation that writes all states to log

func (*Log) Set

func (s *Log) Set(metric string, n int)

Set sets metric state

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory struct is State interface implementation that stores results in memory for further usage

func NewMemory

func NewMemory() *Memory

NewMemory builds and returns new Memory instance

func (*Memory) Metrics

func (i *Memory) Metrics() map[string]int

Metrics returns all previously stored metrics

func (*Memory) Set

func (i *Memory) Set(metric string, n int)

Set sets metric state

type State

type State interface {
	// Set sets metric state
	Set(metric string, n int)
}

State is a metric state interface

type StatsD added in v0.6.0

type StatsD struct {
	// contains filtered or unexported fields
}

StatsD struct is State interface implementation that writes all states to statsd gauge

func NewStatsD added in v0.6.0

func NewStatsD(c *statsd.Client) *StatsD

NewStatsD creates new statsd state instance

func (*StatsD) Set added in v0.6.0

func (s *StatsD) Set(metric string, n int)

Set sets metric state

Jump to

Keyboard shortcuts

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