-
Notifications
You must be signed in to change notification settings - Fork 939
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
Conversation
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
4748f0c
to
09400e8
Compare
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
src/server/dfly_bench.cc
Outdated
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
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()) { |
There was a problem hiding this comment.
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.
src/server/dfly_bench.cc
Outdated
for (size_t pos : key_indices_) { | ||
key = (*keygen_)(); | ||
absl::StrAppend(&cmd_, command_.substr(last_pos, pos - last_pos), key); | ||
last_pos = pos + 7; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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_ptr
s
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤓
* feat: add loadtest skeleton --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io> Co-authored-by: shahar <shahar@dragonflydb.io>
Currently supports only ratio param, without command customization.
Added Normal/Uniform distributions.
Improved printings a bit to make it more useful as a cli.