https://github.com/regadas/go-xstatsd
extra small Go statstd client
https://github.com/regadas/go-xstatsd
Last synced: 8 months ago
JSON representation
extra small Go statstd client
- Host: GitHub
- URL: https://github.com/regadas/go-xstatsd
- Owner: regadas
- Created: 2014-07-19T14:14:37.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-17T12:28:20.000Z (over 11 years ago)
- Last Synced: 2025-10-10T21:04:47.041Z (8 months ago)
- Language: Go
- Homepage:
- Size: 160 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://godoc.org/github.com/regadas/go-xstatsd)
## go-xstatsd ##
This is a very simple/small statsd client that can also allow sending stats in bulk.
**Disclaimer**
This client is based upon the [example](https://github.com/etsy/statsd/tree/master/examples/go) provided by the etsy folks. Thank you etsy!
### Simple example ###
```go
import "github.com/regadas/go-xstatsd"
s := statsd.New("127.0.0.1:8125", "some.metric.prefix")
s.Timing("foobar", 16)
```
### Bulk example ###
```go
import (
"net"
"github.com/regadas/go-xstatsd"
)
s := statsd.New("127.0.0.1:8125", "some.metric.prefix")
s.Client.WithConnection(func(conn *net.Conn) {
s.TimingRaw(conn, "foobar", 16)
s.TimingRaw(conn, "barfoo", 32)
s.IncrementRaw(conn, "bar")
})
```