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

Adds --randomization-alpha flag controlling distribution of repeated queries #564

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

peteralfonsi
Copy link
Contributor

Description

#455 introduced a way to controllably randomize range queries in workloads, which is useful in testing caching behavior. One relevant parameter is Zipf alpha, which changes the shape of the Zipf distribution used for repeated queries. If alpha is small, queries will be more evenly distributed, while if it's large the few most common queries will be preferred more.

I intended to include this as a flag in my original PR but I apparently forgot to do this, and currently alpha is hardcoded to 1. This PR exposes --randomization-alpha so the user can set this value explicitly.

Issues Resolved

N/A

Testing

  • New functionality includes testing

Manually tested in a debug version of this branch, by checking the value of the flag made it to QueryRandomizerWorkloadProcessor.zipf_alpha, and checking the indices generated for different values of alpha match what we would expect.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peter Alfonsi <petealft@amazon.com>
test_execution_parser.add_argument(
"--randomization-alpha",
help=f"The alpha parameter used for the Zipf distribution for query randomization. Low values spread the distribution out, "
f"high values favor the most common queries more. "
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: "more" is redundant. "high values favor the most common queries."

Signed-off-by: Peter Alfonsi <petealft@amazon.com>
@IanHoang IanHoang merged commit 8de0082 into opensearch-project:main Jul 2, 2024
8 checks passed
finnroblin pushed a commit to finnroblin/opensearch-benchmark that referenced this pull request Jul 19, 2024
…queries (opensearch-project#564)

Signed-off-by: Peter Alfonsi <petealft@amazon.com>
Co-authored-by: Peter Alfonsi <petealft@amazon.com>
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.

3 participants