incrementer

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: 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

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 added in v0.6.0

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

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

func NewStatsD added in v0.6.0

func NewStatsD(c *statsd.Client) *StatsD

NewStatsD creates new statsd incrementer instance

func (*StatsD) Increment added in v0.6.0

func (i *StatsD) Increment(metric string)

Increment increments metric in statsd

func (*StatsD) IncrementAll added in v0.6.0

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

IncrementAll increments all metrics for given bucket in statsd

func (*StatsD) IncrementAllN added in v0.6.0

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

IncrementAllN increments all metrics for given bucket in statsd

func (*StatsD) IncrementN added in v0.6.0

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