Documentation ¶
Index ¶
- func Counter(sampleRate float32, bucket string, n ...int)
- func Gauge(sampleRate float32, bucket string, n ...int)
- func GaugeFloat64(sampleRate float32, bucket string, n ...float64)
- func GetCounter(bucket string) metrics.Counter
- func GetGauge(bucket string) metrics.Gauge
- func GetGaugeFloat64(bucket string) metrics.GaugeFloat64
- func GetTiming(bucket string) metrics.Timer
- func SaveCounter(bucket string) error
- func SaveGauge(bucket string) error
- func SaveGaugeFloat64(bucket string) error
- func SaveTiming(bucket string) error
- func SetNamespace(ns string)
- func Timing(sampleRate float32, bucket string, d ...time.Duration)
- type Instrumentation
- func (i *Instrumentation) Counter(sampleRate float32, bucket string, n ...int)
- func (i *Instrumentation) Gauge(sampleRate float32, bucket string, n ...int)
- func (i *Instrumentation) GaugeFloat64(sampleRate float32, bucket string, n ...float64)
- func (i *Instrumentation) GetCounter(bucket string) metrics.Counter
- func (i *Instrumentation) GetGauge(bucket string) metrics.Gauge
- func (i *Instrumentation) GetGaugeFloat64(bucket string) metrics.GaugeFloat64
- func (i *Instrumentation) GetTiming(bucket string) metrics.Timer
- func (i *Instrumentation) SaveCounter(bucket string) error
- func (i *Instrumentation) SaveGauge(bucket string) error
- func (i *Instrumentation) SaveGaugeFloat64(bucket string) error
- func (i *Instrumentation) SaveTiming(bucket string) error
- func (i *Instrumentation) SetNamespace(ns string)
- func (i *Instrumentation) StartRuntime()
- func (i *Instrumentation) StartRusage()
- func (i *Instrumentation) Timing(sampleRate float32, bucket string, d ...time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GaugeFloat64 ¶
Gauge wraps defaultClient.Gauge
func GetCounter ¶
GetCounter wraps defaultClient.GetCounter
func GetGaugeFloat64 ¶
func GetGaugeFloat64(bucket string) metrics.GaugeFloat64
GetGauge wraps defaultClient.GetGauge
func SaveCounter ¶
SaveCounter wraps defaultClient.SaveCounter
func SaveGaugeFloat64 ¶
SaveGauge wraps defaultClient.SaveGauge
func SetNamespace ¶
func SetNamespace(ns string)
SetNamespace wraps defaultClient.SetNamespace The defaultClient will automatically gather and record runtime stats.
Types ¶
type Instrumentation ¶
type Instrumentation struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Instrumentation
New will mint a new Instrumentation - getting statsd connection details from the config service and then looking out for any changes.
func (*Instrumentation) Counter ¶
func (i *Instrumentation) Counter(sampleRate float32, bucket string, n ...int)
Counter records an increment or decrement to a counter value for the specified bucket. If sampleRate is < 1.0 then we will sample values to send on to statsd appropriately.
func (*Instrumentation) Gauge ¶
func (i *Instrumentation) Gauge(sampleRate float32, bucket string, n ...int)
Gauge records a value to the gauge for the specified bucket. If sampleRate is < 1.0 then we will sample values to send on to statsd appropriately, but use this functionality with care, especially with gauges that may not be updated very often.
func (*Instrumentation) GaugeFloat64 ¶
func (i *Instrumentation) GaugeFloat64(sampleRate float32, bucket string, n ...float64)
GaugeFloat32 records a float value to the gauge for the specified bucket. If sampleRate is < 1.0 then we will sample values to send on to statsd appropriately, but use this functionality with care, especially with gauges that may not be updated very often.
func (*Instrumentation) GetCounter ¶
func (i *Instrumentation) GetCounter(bucket string) metrics.Counter
GetCounter yields a Counter that we can query directly to find out how many things have been counted.
func (*Instrumentation) GetGauge ¶
func (i *Instrumentation) GetGauge(bucket string) metrics.Gauge
GetGauge returns a Gauge that we can query directly to find out the value of a gauge.
func (*Instrumentation) GetGaugeFloat64 ¶
func (i *Instrumentation) GetGaugeFloat64(bucket string) metrics.GaugeFloat64
GetGauge returns a Gauge that we can query directly to find out the value of a gauge.
func (*Instrumentation) GetTiming ¶
func (i *Instrumentation) GetTiming(bucket string) metrics.Timer
GetTiming yields a Timer that we can query directly to find out how many things have been timed (the rate) plus various stats about the aggregate timing like mean, stddev etc.
func (*Instrumentation) SaveCounter ¶
func (i *Instrumentation) SaveCounter(bucket string) error
SaveCounter indicates that we want to store an internal representation of the counts in this bucket so that we can query it (via GetCounter).
func (*Instrumentation) SaveGauge ¶
func (i *Instrumentation) SaveGauge(bucket string) error
SaveGauge indicates that we want to store an internal representation of the value of this gauge so that we can query it (via GetGauge).
func (*Instrumentation) SaveGaugeFloat64 ¶
func (i *Instrumentation) SaveGaugeFloat64(bucket string) error
SaveGauge indicates that we want to store an internal representation of the value of this gauge so that we can query it (via GetGauge).
func (*Instrumentation) SaveTiming ¶
func (i *Instrumentation) SaveTiming(bucket string) error
SaveTiming indicates that we want to store an internal representation of all timings in this bucket so that we can query it (via GetTiming).
func (*Instrumentation) SetNamespace ¶
func (i *Instrumentation) SetNamespace(ns string)
SetNamespace defines a namespace for all metrics send to statsd - where this will be prepended to each bucket name
func (*Instrumentation) StartRuntime ¶
func (i *Instrumentation) StartRuntime()
StartRuntime starts a sampling loop that samples runtime statistics and feeds them into this instrumentation value. It spawns a background goroutine.
func (*Instrumentation) StartRusage ¶
func (i *Instrumentation) StartRusage()
StartRuntime starts a sampling loop that samples runtime statistics and feeds them into this instrumentation value. It spawns a background goroutine.