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

add loadtest benchmarking program #2603

Merged
merged 7 commits into from
Feb 18, 2024
Merged

add loadtest benchmarking program #2603

merged 7 commits into from
Feb 18, 2024

Conversation

romange
Copy link
Collaborator

@romange romange commented Feb 16, 2024

Currently supports only ratio param, without command customization.
Added Normal/Uniform distributions.
Improved printings a bit to make it more useful as a cli.

@romange romange requested a review from chakaz February 16, 2024 08:04
@romange romange force-pushed the loadtest branch 2 times, most recently from 4748f0c to 09400e8 Compare February 17, 2024 21:21
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
chakaz
chakaz previously approved these changes Feb 18, 2024
CHECK(absl::SimpleAtoi(ratio_str.first, &ratio_set_));
CHECK(absl::SimpleAtoi(ratio_str.second, &ratio_get_));
} else {
for (size_t pos = 0; (pos = command_.find("__key__", pos)) != string::npos; pos += 7) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit

Suggested change
for (size_t pos = 0; (pos = command_.find("__key__", pos)) != string::npos; pos += 7) {
constexpr string_view kKeyPlaceholder = "__key__"sv;
for (size_t pos = 0; (pos = command_.find(kKeyPlaceholder, pos)) != string::npos; pos += kKeyPlaceholder.size()) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For my defense this code was written by copilot.

for (size_t pos : key_indices_) {
key = (*keygen_)();
absl::StrAppend(&cmd_, command_.substr(last_pos, pos - last_pos), key);
last_pos = pos + 7;
Copy link
Collaborator

Choose a reason for hiding this comment

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

see above
maybe make kKeyPlaceholder global

socket_.reset(p->CreateSocket());
}

Driver(const Driver&) = delete;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: you could make this class movable (default should work: Driver(Driver&&) = default), which will allow you below to hold a vector<Driver> instead of using unique_ptrs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do not know if it is better but done :)

Copy link
Collaborator

@chakaz chakaz left a comment

Choose a reason for hiding this comment

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

🤓

@romange romange merged commit 417ca95 into main Feb 18, 2024
10 checks passed
@romange romange deleted the loadtest branch February 18, 2024 14:51
lsvmello pushed a commit to lsvmello/dragonfly that referenced this pull request Feb 19, 2024
* feat: add loadtest skeleton
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: shahar <shahar@dragonflydb.io>
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.

2 participants