Documentation
¶
Overview ¶
Package stats provides an interface for instrumenting Empire.
Index ¶
- Variables
- func Gauge(ctx context.Context, name string, value float32, rate float32, tags []string) error
- func Histogram(ctx context.Context, name string, value float32, rate float32, tags []string) error
- func Inc(ctx context.Context, name string, value int64, rate float32, tags []string) error
- func Runtime(stats Stats)
- func SampleEvery(stats Stats, t time.Duration)
- func Timing(ctx context.Context, name string, value time.Duration, rate float32, ...) error
- func WithStats(ctx context.Context, stats Stats) context.Context
- func WithTags(ctx context.Context, tags []string) context.Context
- type Dogstatsd
- func (s *Dogstatsd) Gauge(name string, value float32, rate float32, tags []string) error
- func (s *Dogstatsd) Histogram(name string, value float32, rate float32, tags []string) error
- func (s *Dogstatsd) Inc(name string, value int64, rate float32, tags []string) error
- func (s *Dogstatsd) Timing(name string, value time.Duration, rate float32, tags []string) error
- type Stats
- type Statsd
- func (s *Statsd) Gauge(name string, value float32, rate float32, tags []string) error
- func (s *Statsd) Histogram(name string, value float32, rate float32, tags []string) error
- func (s *Statsd) Inc(name string, value int64, rate float32, tags []string) error
- func (s *Statsd) Timing(name string, value time.Duration, rate float32, tags []string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Null = &nullStats{}
Functions ¶
func Runtime ¶
func Runtime(stats Stats)
Runtime enters into a loop, sampling and outputing the runtime stats periodically.
func SampleEvery ¶
SampleEvery enters a loop, sampling at the specified interval
Types ¶
type Dogstatsd ¶
Dogstatsd provides an implementation of the Stats interface backed by dogstatsd.
func NewDogstatsd ¶
NewDogstatsd returns a new Dogstatsd instance that sends statsd metrics to addr.
type Stats ¶
type Stats interface { Inc(name string, value int64, rate float32, tags []string) error Timing(name string, value time.Duration, rate float32, tags []string) error Gauge(name string, value float32, rate float32, tags []string) error Histogram(name string, value float32, rate float32, tags []string) error }
Stats provides an interface for generating instruments, like guages and counts.
type Statsd ¶
type Statsd struct {
// contains filtered or unexported fields
}
Statsd is an implementation of the Stats interface backed by statsd.
Click to show internal directories.
Click to hide internal directories.