tim-group / java-statsd-client

a java statsd client library
Other
275 stars 139 forks source link

implements sampling #33

Open mcfunley opened 9 years ago

mcfunley commented 9 years ago

Sampling is intended to be implemented by statsd clients. If the sampleRate provided is 0.5, for example, that implies that the client is only sending 50% of the packets and that the server should scale up the number of counts received by a factor of two. See for example the PHP client.

The existing implementation of the java client sends along a sample rate, but it doesn't actually sample. This PR fixes that issue.

mcfunley commented 9 years ago

The issue with the tests is that ThreadLocalRandom is new in Java 7, and this is targeting Java 6 apparently. The documentation warns about contention with Math.Random, which is why I switched it. I think the best thing to do is upgrade to Java 7, but lmk if you'd rather go the other way with this and I'll fix it.

nemoo commented 9 years ago

Upgrade to Java 7 sounds good. Java 6 is really kinda dated nowadays.

coderlol commented 8 years ago

Is this PR in a release?

GuiSim commented 8 years ago

Is this repo dead?

waynr commented 7 years ago

https://github.com/DataDog/java-dogstatsd-client appears to be a more actively maintained version of this project, I recommend submitting your patch there if you have not already done so.