quipo / statsd

Golang StatsD client
MIT License
164 stars 51 forks source link

fixes to buffered client, adds floats and delta gauges #5

Closed nsd20463 closed 9 years ago

nsd20463 commented 9 years ago

I fixed the make() len/cap bug, and removed the FQDN hostname truncation, and the initialization of Hostname. I left the Hostname exported so clients can truncate it themselves. The rest is the same as the previous pull request.

I started using your statsd package. I found the buffered client didn't support %HOST%, so I fixed that. I found there was a typo in buffered gauges.

Then I realized that gauges needed two APIS, one for absolute valued gauges, and one for deltas. So I split the gauge API into the regular gauge (Gauge() and FGauge()) and deltas (GaugeDelta() and FGaugeDelta()). That let me handle negative gauge values correctly.

You can pick and choose whatever you like (especially since the GaugeDelta() change breaks the API --- the existing API is that a regular Gauge() is delta, while a buffered gauge is absolute for + values, and delta for negative values, which is somewhat broken)

-Nicolas Dade

quipo commented 9 years ago

Hi Nicolas, thanks for your changes, they look good. I only added a couple of notes with questions before merging. Thanks!

nsd20463 commented 9 years ago

I added comments. Then I fixed by bug, removed the Hostname truncation code, and sent an updated pull request.

-N

On Mon, Nov 10, 2014 at 2:25 AM, Lorenzo Alberton notifications@github.com wrote:

Hi Nicolas, thanks for your changes, they look good. I only added a couple of notes with questions before merging. Thanks!

— Reply to this email directly or view it on GitHub https://github.com/quipo/statsd/pull/5#issuecomment-62365857.

quipo commented 9 years ago

Thanks!