Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implements sampling #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

implements sampling #33

wants to merge 3 commits into from

Conversation

mcfunley
Copy link

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
Copy link
Author

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
Copy link

nemoo commented Jun 22, 2015

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

@coderlol
Copy link

coderlol commented Oct 2, 2015

Is this PR in a release?

@GuiSim
Copy link

GuiSim commented Jan 11, 2016

Is this repo dead?

@waynr
Copy link

waynr commented Sep 21, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants