Documentation ¶
Overview ¶
Package reporter provides default reporting functionnality.
Index ¶
- Variables
- func Get(name string) interface{}
- func Librato(email, token, source string, r *Registry, d time.Duration)
- func Log(source string, r *Registry, d time.Duration)
- func NewRegisteredCounter(name string) *instruments.Counter
- func NewRegisteredDerive(name string, value int64) *instruments.Derive
- func NewRegisteredGauge(name string, value int64) *instruments.Gauge
- func NewRegisteredRate(name string) *instruments.Rate
- func NewRegisteredReservoir(name string, size int64) *instruments.Reservoir
- func NewRegisteredTimer(name string, size int64) *instruments.Timer
- func Register(name string, v interface{}) interface{}
- func Snapshot() map[string]interface{}
- func Unregister(name string)
- type Registry
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRegistry = NewRegistry()
DefaultRegistry is the default registry.
Functions ¶
func Get ¶
func Get(name string) interface{}
Get returns the named instruments from the default registry.
func Librato ¶
Librato logs metrics to librato every given duration.
Example ¶
registry := NewRegistry() go Librato("account@librato.com", "<token>", "source", registry, time.Minute)
Output:
func Log ¶
Log logs metrics using logfmt every given duration.
Example ¶
registry := NewRegistry() go Log("source", registry, time.Minute)
Output:
func NewRegisteredCounter ¶
func NewRegisteredCounter(name string) *instruments.Counter
func NewRegisteredDerive ¶
func NewRegisteredDerive(name string, value int64) *instruments.Derive
func NewRegisteredGauge ¶
func NewRegisteredGauge(name string, value int64) *instruments.Gauge
func NewRegisteredRate ¶
func NewRegisteredRate(name string) *instruments.Rate
func NewRegisteredReservoir ¶
func NewRegisteredReservoir(name string, size int64) *instruments.Reservoir
func NewRegisteredTimer ¶
func NewRegisteredTimer(name string, size int64) *instruments.Timer
func Register ¶
func Register(name string, v interface{}) interface{}
Register a new instruments in the default registry.
func Snapshot ¶
func Snapshot() map[string]interface{}
Snapshot returns all instruments and reset the default registry.
func Unregister ¶
func Unregister(name string)
Unregister remove the named instruments from the default registry.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a registry of all instruments.
func (*Registry) Instruments ¶
Instruments returns all instruments.
func (*Registry) Unregister ¶
Unregister remove from the registry the instrument matching the given name.
Click to show internal directories.
Click to hide internal directories.