stats

package
v0.0.0-...-0e65dd1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2015 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicMeter

type BasicMeter interface {
	// Occurence - Something worth measuring happened
	// Data worth knowing:
	// How many times total did it happen
	// How many event / time is happening
	Occurence(name string) //moment

	// Duration - Called after a process has completed, captures both that an
	// occurence of a process happened and how long it took.
	Duration(name string, start time.Time)

	// Distribution - Capture the distribution of a value. Mean, Max, Min, Avg, 95%
	Distribution(name string, value float64)

	// Current - A value where the actual value is the only thing that matters. A level or gauge.
	Value(name string, value float64)

	// Size - Track payload sizes
	Size(name string, size int64)
}

BasicMeter Discussion Points - Why does duration & size exist on the interface when they can be covered by the other interfaces? A: Believe that fundamental building blocks, the atoms, of a system should be easily tracked Duration and Data Size are fundamental building blocks for reasoning about a software system.

func NewBasicMeter

func NewBasicMeter(name, environment string, tags ...string) BasicMeter

type FullMeter

type FullMeter interface {
	Hit(name string, start time.Time)
	Miss(name string, start time.Time)
	Outcome(name string, outcome string, start time.Time)
	BasicMeter
}

func NewMeter

func NewMeter(name, environment string, tags ...string) FullMeter

type Metrics

type Metrics struct {
	//Name - the name of this group of metrics
	Name        string
	Tags        []string
	Hostname    string
	Environment string
}

func (*Metrics) Distribution

func (m *Metrics) Distribution(name string, value float64)

Distribution - Capture the distribution of a value. Mean, Max, Min, Avg, 95%

func (*Metrics) Duration

func (m *Metrics) Duration(name string, start time.Time)

Duration - Called after a process has completed, captures both that an occurence of a process happened and how long it took.

func (*Metrics) Hit

func (m *Metrics) Hit(name string, start time.Time)

Hit - Cache hit

func (*Metrics) Miss

func (m *Metrics) Miss(name string, start time.Time)

Miss - Cache miss

func (*Metrics) Occurence

func (m *Metrics) Occurence(name string)

func (*Metrics) Outcome

func (m *Metrics) Outcome(name string, outcome string, start time.Time)

Outcome

func (*Metrics) Size

func (m *Metrics) Size(name string, size int64)

func (*Metrics) Value

func (m *Metrics) Value(name string, value float64)

Current - A value where the actual value is the only thing that matters. A level or gauge.

Jump to

Keyboard shortcuts

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