-- import "github.com/statsd/datadog"
Package datadog implements a simple dogstatsd client
c, err := Dial(":5000")
c.SetPrefix("myprogram")
c.SetTags("env:stage", "program:myprogram")
c.Incr("count")
type Client struct {
sync.Mutex
}Client represents a datadog client.
func Dial(addr string) (*Client, error)Dial connects to addr and returns a client.
func DialSize(addr string, size int) (*Client, error)DialSize connects with the given buffer size. see https://git.io/vzC0D.
func New(w io.Writer) *ClientNew returns a new Client with writer w, useful for testing.
func (c *Client) Close() errorClose will flush and close the connection.
func (c *Client) Decr(name string, tags ...string) errorDecr decrements counter name with tags.
func (c *Client) DecrBy(name string, n int, tags ...string) errorDecrBy decrements counter name by n with optional tags.
func (c *Client) Duration(name string, d time.Duration, tags ...string) errorDuration uses Histogram() to send the given d duration.
func (c *Client) Flush() errorFlush will flush the underlying buffer.
func (c *Client) Gauge(name string, n int, tags ...string) errorGauge sets the metric name to n at a given time.
func (c *Client) Histogram(name string, v int, tags ...string) errorHistogram measures the statistical distribution of a metric name with the
given v value, rate and tags.
func (c *Client) Incr(name string, tags ...string) errorIncr increments counter name with tags.
func (c *Client) IncrBy(name string, n int, tags ...string) errorIncrBy increments counter name by n with optional tags.
func (c *Client) Increment(name string, count int, rate float64, tags ...string) errorIncrement incremenets the given stat name with the given count, rate and
tags....
func (c *Client) SetPrefix(name string)SetPrefix sets global prefix name.
func (c *Client) SetTags(tags ...string)SetTags sets global tags tags....
func (c *Client) Unique(name, value string, tags ...string) errorUnique records a unique occurence of events.