instruments: github.com/heroku/instruments/reporter Index | Examples | Files

package reporter

import "github.com/heroku/instruments/reporter"

Package reporter provides default reporting functionnality.

Index

Examples

Package Files

librato.go log.go registry.go

Variables

var DefaultRegistry = NewRegistry()

DefaultRegistry is the default registry.

func Get Uses

func Get(name string) interface{}

Get returns the named instruments from the default registry.

func Librato Uses

func Librato(email, token, source string, r *Registry, d time.Duration)

Librato logs metrics to librato every given duration.

Code:

registry := NewRegistry()
go Librato("account@librato.com", "<token>", "source", registry, time.Minute)

func Log Uses

func Log(source string, r *Registry, d time.Duration)

Log logs metrics using logfmt every given duration.

Code:

registry := NewRegistry()
go Log("source", registry, time.Minute)

func NewRegisteredCounter Uses

func NewRegisteredCounter(name string) *instruments.Counter

func NewRegisteredDerive Uses

func NewRegisteredDerive(name string, value int64) *instruments.Derive

func NewRegisteredGauge Uses

func NewRegisteredGauge(name string, value int64) *instruments.Gauge

func NewRegisteredRate Uses

func NewRegisteredRate(name string) *instruments.Rate

func NewRegisteredReservoir Uses

func NewRegisteredReservoir(name string, size int64) *instruments.Reservoir

func NewRegisteredTimer Uses

func NewRegisteredTimer(name string, size int64) *instruments.Timer

func Register Uses

func Register(name string, v interface{}) interface{}

Register a new instruments in the default registry.

func Snapshot Uses

func Snapshot() map[string]interface{}

Snapshot returns all instruments and reset the default registry.

func Unregister Uses

func Unregister(name string)

Unregister remove the named instruments from the default registry.

type Registry Uses

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

Registry is a registry of all instruments.

func NewRegistry Uses

func NewRegistry() *Registry

NewRegistry creates a new Register.

func (*Registry) Get Uses

func (r *Registry) Get(name string) interface{}

Get returns an instrument from the Registry.

func (*Registry) Instruments Uses

func (r *Registry) Instruments() map[string]interface{}

Instruments returns all instruments.

func (*Registry) Register Uses

func (r *Registry) Register(name string, v interface{}) interface{}

Register registers a new instrument or return the existing one.

func (*Registry) Size Uses

func (r *Registry) Size() int

Size returns the numbers of instruments in the registry.

func (*Registry) Snapshot Uses

func (r *Registry) Snapshot() map[string]interface{}

Snapshot returns and reset all instruments.

func (*Registry) Unregister Uses

func (r *Registry) Unregister(name string)

Unregister remove from the registry the instrument matching the given name.

Package reporter imports 9 packages (graph). Updated 2017-02-07. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).