https://github.com/sokil/go-statsd-client
ABANDONED! Go to https://github.com/GoMetric/go-statsd-client. Client for StatsD (Golang)
https://github.com/sokil/go-statsd-client
go golang statsd statsd-client udp
Last synced: 5 months ago
JSON representation
ABANDONED! Go to https://github.com/GoMetric/go-statsd-client. Client for StatsD (Golang)
- Host: GitHub
- URL: https://github.com/sokil/go-statsd-client
- Owner: sokil
- License: mit
- Archived: true
- Created: 2017-10-04T18:32:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-15T13:47:17.000Z (over 7 years ago)
- Last Synced: 2024-06-21T04:32:15.358Z (almost 2 years ago)
- Topics: go, golang, statsd, statsd-client, udp
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-statsd-client
**ABANDONED**: Go to https://github.com/GoMetric/go-statsd-client
Client for StatsD (Golang)
[](https://goreportcard.com/report/github.com/sokil/go-statsd-client)
[](https://godoc.org/github.com/sokil/go-statsd-client)
[](https://travis-ci.org/sokil/go-statsd-client)
[](https://codeclimate.com/github/sokil/go-statsd-client)
## Usage
Client may be in buffered and unbuffered mode.
In buffered mode adding metric only adds it to buffer. Then `client.Flush()` builds all metrics to
packed and sends them to StatsD server by one request.
In unbuffered mode each metric sends to StatsD immediately.
Creating unbuffered client:
```go
client := NewClient("127.0.0.1", 9876) # create client
client.Open() # open connection to StatsD
client.Count('a.b.c', 42, 0.7) # set count metric and send it to StatsD
```
Creating buffered client:
```go
client := NewBufferedClient("127.0.0.1", 9876) # create client
client.Open() # open connection to StatsD
client.Count('a.b.c', 42, 0.7) # set count metric and add it to buffer
client.Timing('a.b.d', 43) # set timing metric and add it to buffer
client.Flush() # send all metrics as one packet to StatsD
```
## See also
* [HTTP proxy to StatsD with REST interface for using in browsers](https://github.com/sokil/statsd-http-proxy)