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

Default sample rate #110

Merged
merged 2 commits into from
Jun 14, 2019
Merged

Conversation

claytono
Copy link
Contributor

This adds a flag to the constructor to allow setting a default sample rate, if the caller doesn't set one on each call. This also fixes a minor problem in the sampling test cases and a bug with the sampling edge case that it was hiding.

The test case for the sampling rate equalling the random value was not
testing the right scenario, which hid the fact that it was actually
failing.
Allow providing a sample rate when creating the statsd object.  This is
only used if the caller doesn't provide one when updating a metric.
@albertvaka
Copy link
Contributor

Thanks for your contribution @claytono 😃And sorry this took so long to review 😥

Looks good to me, merging!

@albertvaka albertvaka merged commit 604ddcc into DataDog:master Jun 14, 2019
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.

None yet

2 participants