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

Usability updates for lua bench testing #253

Merged
merged 1 commit into from
Apr 19, 2024
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NuRaft*/
curl*/
jsoncpp*/
ethash*/
lua*/
lua-*/
benchmark-results/
CMakeFiles/
plots/
Expand Down
36 changes: 36 additions & 0 deletions scripts/lua_bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

IP="localhost"
PORT="8889"
N_WALLETS=5
LOGLEVEL="WARN"

function print_help() {
echo "Usage: lua_bench.sh [OPTIONS]"
echo ""
echo "OPTIONS:"
echo " --ip The IP address to use. Default is localhost."
echo " --port The port number to use. Default is 8888."
echo " --loglevel The log level to use. Default is WARN."
echo " -h, --help Show this help message and exit."
echo ""
}

for arg in "$@"; do
if [[ "$arg" == "-h" || "$arg" == "--help" ]]; then
print_help
exit 0
elif [[ "$arg" == "--ip"* ]]; then
IP="${arg#--ip=}"
elif [[ "$arg" == "--port"* ]]; then
PORT="${arg#--port=}"
elif [[ "$arg" == "--loglevel"* ]]; then
LOGLEVEL="${arg#--loglevel=}"
fi
done
./build/tools/bench/parsec/lua/lua_bench --component_id=0 \
--ticket_machine0_endpoint=$IP:7777 --ticket_machine_count=1 \
--shard_count=1 --shard0_count=1 --shard00_endpoint=$IP:5556 \
--agent_count=1 --agent0_endpoint=$IP:$PORT \
--loglevel=$LOGLEVEL scripts/gen_bytecode.lua $N_WALLETS
echo done
1 change: 1 addition & 0 deletions tools/bench/parsec/lua/lua_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ auto main(int argc, char** argv) -> int {
log->error("Error parsing options");
return 1;
}
log->set_loglevel(cfg->m_loglevel);

auto args = cbdc::config::get_args(argc, argv);
auto n_wallets = std::stoull(args.back());
Expand Down
Loading