state

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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