statsd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package statsd implements an statsd client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedStatsd

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

BufferedStatsd represents a buffered statsd client.

func NewBuffered

func NewBuffered(addr, prefix string, opts ...BufferedStatsdFunc) (*BufferedStatsd, error)

NewBuffered create a buffered Statsd instance.

func (*BufferedStatsd) Close

func (s *BufferedStatsd) Close() error

Close closes the client and flushes buffered stats, if applicable

func (*BufferedStatsd) Gauge

func (s *BufferedStatsd) Gauge(name string, value float64, rate float32, tags ...string)

Gauge measures the value of a metric.

func (*BufferedStatsd) Inc

func (s *BufferedStatsd) Inc(name string, value int64, rate float32, tags ...string)

Inc increments a count by the value.

func (*BufferedStatsd) Timing

func (s *BufferedStatsd) Timing(name string, value time.Duration, rate float32, tags ...string)

Timing sends the value of a Duration.

type BufferedStatsdFunc

type BufferedStatsdFunc func(*BufferedStatsd)

BufferedStatsdFunc represents an configuration function for BufferedStatsd.

func WithFlushBytes

func WithFlushBytes(bytes int) BufferedStatsdFunc

WithFlushBytes sets the maximum udp packet size that will be sent. Defaults to 1432 flushBytes.

func WithFlushInterval

func WithFlushInterval(interval time.Duration) BufferedStatsdFunc

WithFlushInterval sets the maximum flushInterval for packet sending. Defaults to 300ms.

type Statsd

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

Statsd is a statsd client.

func New

func New(addr, prefix string) (*Statsd, error)

New returns a statsd instance.

func (*Statsd) Close

func (s *Statsd) Close() error

Close closes the client and flushes buffered stats, if applicable

func (*Statsd) Gauge

func (s *Statsd) Gauge(name string, value float64, rate float32, tags ...string)

Gauge measures the value of a metric.

func (*Statsd) Inc

func (s *Statsd) Inc(name string, value int64, rate float32, tags ...string)

Inc increments a count by the value.

func (*Statsd) Timing

func (s *Statsd) Timing(name string, value time.Duration, rate float32, tags ...string)

Timing sends the value of a Duration.

Jump to

Keyboard shortcuts

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