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

GEODE-10371: C++ client: Improve dispersion on connections expiration #974

Merged
merged 2 commits into from Jul 6, 2022

Conversation

albertogpz
Copy link
Contributor

No description provided.

@albertogpz albertogpz marked this pull request as ready for review June 10, 2022 09:52
return random;
std::random_device rd;
std::default_random_engine generator(rd());
std::uniform_int_distribution<int> distribution(-9, 9);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to add a couple of constants to add some semantic meaning to the distribution limits

std::unique_ptr<TcrConnectionTest>(new TcrConnectionTest(
static_cast<const TcrConnectionManager>(nullptr)));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a suggestion for a change to this case or maybe for another case, but given the goal of this change is to ensure the variance is evenly distributed along the connections created within a close period of time, I'd suggest instead of comparing with the first value, I'd rather sample the distribution and check no bucket in the sample has more than x times (i.e double) the expected amount.

@albertogpz albertogpz merged commit d4d0990 into apache:develop Jul 6, 2022
@albertogpz albertogpz deleted the feature/GEODE-10371 branch July 7, 2022 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants