open-consul/vendor/github.com/DataDog/datadog-go/statsd
Sean Chittenden 333ff22e9a Manage dependencies via Godep
Embrace the future and use Go 1.6's vendor support via Godep.

Go 1.5 users should `export GO15VENDOREXPERIMENT=1`
2016-02-12 16:50:37 -08:00
..
README.md Manage dependencies via Godep 2016-02-12 16:50:37 -08:00
statsd.go Manage dependencies via Godep 2016-02-12 16:50:37 -08:00

README.md

Overview

Package statsd provides a Go dogstatsd client. Dogstatsd extends Statsd, adding tags and histograms.

Get the code

$ go get github.com/DataDog/datadog-go/statsd

Usage

// Create the client
c, err := statsd.New("127.0.0.1:8125")
if err != nil {
    log.Fatal(err)
}
// Prefix every metric with the app name
c.Namespace = "flubber."
// Send the EC2 availability zone as a tag with every metric
c.Tags = append(c.Tags, "us-east-1a")
err = c.Gauge("request.duration", 1.2, nil, 1)

Buffering Client

Dogstatsd accepts packets with multiple statsd payloads in them. Using the BufferingClient via NewBufferingClient will buffer up commands and send them when the buffer is reached or after 100msec.

Development

Run the tests with:

$ go test

Documentation

Please see: http://godoc.org/github.com/DataDog/datadog-go/statsd

License

go-dogstatsd is released under the MIT license.

Credits

Original code by ooyala.