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

Improved the quality of randomness used for sampling. #133

Merged
merged 1 commit into from Jul 31, 2012

Conversation

otac0n
Copy link
Contributor

@otac0n otac0n commented Jul 31, 2012

The previous version had issues with rapidly creating and disposing of StatsdPipe instances.

If, say, 100 were created in the same millisecond, they would all be given the same Random seed.

In this version, we use ThreadStatic storage to reduce the number of Random instances created, maintain thread safety, and allow randomness to vary much more quickly than per-millisecond.

The previous version had issues with rapidly creating and disposing of StatsdPipe instances.

If, say, 100 were created in the same millisecond, they would all be given the same Random seed.

In this version, we use ThreadStatic storage to reduce the number of Random instances created, maintain thread safety, and allow randomness to vary much more quickly that per-millisecond.
@travisbot
Copy link

This pull request passes (merged da8d73b into a98c905).

@mrtazz
Copy link
Member

mrtazz commented Jul 31, 2012

Nice addition, thanks for the patch!

mrtazz added a commit that referenced this pull request Jul 31, 2012
Improved the quality of randomness used for sampling.
@mrtazz mrtazz merged commit 4682f7f into statsd:master Jul 31, 2012
hbouvier pushed a commit to hbouvier/statsd that referenced this pull request May 25, 2013
Improved the quality of randomness used for sampling.
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

3 participants