incrementer

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Incrementer

type Incrementer interface {
	// Increment increments metric
	Increment(metric string)

	// IncrementN increments metric by n
	IncrementN(metric string, n int)

	// Increment increments all metrics for given bucket
	IncrementAll(b bucket.Bucket)

	// Increment increments all metrics for given bucket by n
	IncrementAllN(b bucket.Bucket, n int)
}

Incrementer is a metric incrementer interface

func New

func New(c *statsd.Client, muted bool) Incrementer

New builds and returns new Incrementer instance

type Log

type Log struct{}

Log struct is Incrementer interface implementation that writes all metrics to log

func (*Log) Increment

func (i *Log) Increment(metric string)

Increment writes given metric to log

func (*Log) IncrementAll

func (i *Log) IncrementAll(b bucket.Bucket)

IncrementAll writes all metrics for given bucket to log

func (*Log) IncrementAllN

func (i *Log) IncrementAllN(b bucket.Bucket, n int)

IncrementAllN writes all metrics for given bucket to log

func (*Log) IncrementN

func (i *Log) IncrementN(metric string, n int)

IncrementN writes given metric to log

type Memory

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

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

func NewMemory

func NewMemory() *Memory

NewMemory builds and returns new Memory instance

func (*Memory) Increment

func (i *Memory) Increment(metric string)

Increment increments given metric in memory

func (*Memory) IncrementAll

func (i *Memory) IncrementAll(b bucket.Bucket)

IncrementAll increments all metrics for given bucket in memory

func (*Memory) IncrementAllN

func (i *Memory) IncrementAllN(b bucket.Bucket, n int)

IncrementAllN increments all metrics for given bucket in memory

func (*Memory) IncrementN

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

IncrementN increments given metric in memory

func (*Memory) Metrics

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

Metrics returns all previously stored metrics

type Statsd

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

Statsd struct is Incrementer interface implementation that writes all metrics to statsd

func (*Statsd) Increment

func (i *Statsd) Increment(metric string)

Increment increments metric in statsd

func (*Statsd) IncrementAll

func (i *Statsd) IncrementAll(b bucket.Bucket)

IncrementAll increments all metrics for given bucket in statsd

func (*Statsd) IncrementAllN

func (i *Statsd) IncrementAllN(b bucket.Bucket, n int)

IncrementAllN increments all metrics for given bucket in statsd

func (*Statsd) IncrementN

func (i *Statsd) IncrementN(metric string, n int)

IncrementN increments metric by n in statsd

Jump to

Keyboard shortcuts

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