instrumentation

package
v0.0.0-...-cbea63e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Counter

func Counter(sampleRate float32, bucket string, n ...int)

Counter wraps defaultClient.Counter

func Gauge

func Gauge(sampleRate float32, bucket string, n ...int)

Gauge wraps defaultClient.Gauge

func GaugeFloat64

func GaugeFloat64(sampleRate float32, bucket string, n ...float64)

Gauge wraps defaultClient.Gauge

func GetCounter

func GetCounter(bucket string) metrics.Counter

GetCounter wraps defaultClient.GetCounter

func GetGauge

func GetGauge(bucket string) metrics.Gauge

GetGauge wraps defaultClient.GetGauge

func GetGaugeFloat64

func GetGaugeFloat64(bucket string) metrics.GaugeFloat64

GetGauge wraps defaultClient.GetGauge

func GetTiming

func GetTiming(bucket string) metrics.Timer

GetTiming wraps defaultClient.GetTiming

func SaveCounter

func SaveCounter(bucket string) error

SaveCounter wraps defaultClient.SaveCounter

func SaveGauge

func SaveGauge(bucket string) error

SaveGauge wraps defaultClient.SaveGauge

func SaveGaugeFloat64

func SaveGaugeFloat64(bucket string) error

SaveGauge wraps defaultClient.SaveGauge

func SaveTiming

func SaveTiming(bucket string) error

SaveTiming wraps defaultClient.SaveTiming

func SetNamespace

func SetNamespace(ns string)

SetNamespace wraps defaultClient.SetNamespace The defaultClient will automatically gather and record runtime stats.

func Timing

func Timing(sampleRate float32, bucket string, d ...time.Duration)

Timing wraps defaultClient.Timing

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.

func (*Instrumentation) Timing

func (i *Instrumentation) Timing(sampleRate float32, bucket string, d ...time.Duration)

Timing records a duration to a timer value for the specified bucket. If sampleRate is < 1.0 then we will sample values to send on to statsd appropriately.

Jump to

Keyboard shortcuts

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