quipo / statsd

Golang StatsD client
MIT License
164 stars 51 forks source link

Feature tcp #24

Closed hoffoo closed 8 years ago

hoffoo commented 9 years ago

I would like to support sending via tcp

Other libs that do this solve it by appending a newline to each metric. I tested that this works with statsite and etsy/statsd.

quipo commented 8 years ago

cool! Can I suggest a small change? Instead of the tcpNewLine property, can you set a new eventStringTpl property, by default set to "%s%s:%s", and set to "%s%s:%s\n" in CreateTCPSocket(), and then use format = fmt.Sprintf(c.eventStringTpl, c.prefix, stat, format) in send() so we avoid one check in every send() call

hoffoo commented 8 years ago

Hi - how does this look?