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

Added client_id and topic start index setting functionality. #905

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions example/bench.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ threads_per_ioc=0


## publish load settings

# number of publishes for each client. after all published, the benci will finish
times=1

# start index of clients and topics
start_index=0

# number of clients for connection
clients=1

Expand Down
14 changes: 10 additions & 4 deletions example/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ int main(int argc, char **argv) {
boost::program_options::value<std::uint32_t>()->default_value(0),
"set session expiry interval to client"
)
(
"start_index",
boost::program_options::value<std::size_t>()->default_value(0),
"start index of clients and topics"
)
(
"times",
boost::program_options::value<std::size_t>()->default_value(1000),
Expand Down Expand Up @@ -319,6 +324,7 @@ int main(int argc, char **argv) {
auto compare = vm["compare"].as<bool>();

auto clients = vm["clients"].as<std::size_t>();
auto start_index = vm["start_index"].as<std::size_t>();
auto times = vm["times"].as<std::size_t>();
if (times == 0) {
std::cout << "times must be greater than 0" << std::endl;
Expand Down Expand Up @@ -1044,7 +1050,7 @@ int main(int argc, char **argv) {
port,
version
),
i,
i + start_index,
payload_size,
times,
pub_idle_count
Expand Down Expand Up @@ -1081,7 +1087,7 @@ int main(int argc, char **argv) {
port,
version
),
i,
i + start_index,
payload_size,
times,
pub_idle_count
Expand Down Expand Up @@ -1128,7 +1134,7 @@ int main(int argc, char **argv) {
ws_path ? ws_path.value() : std::string(),
version
),
i,
i + start_index,
payload_size,
times,
pub_idle_count
Expand Down Expand Up @@ -1171,7 +1177,7 @@ int main(int argc, char **argv) {
ws_path ? ws_path.value() : std::string(),
version
),
i,
i + start_index,
payload_size,
times,
pub_idle_count
Expand Down