Skip to content

Commit

Permalink
Usability updates for lua bench testing
Browse files Browse the repository at this point in the history
Add in script for running lua bench, and add
configurable logging to the lua bench test.

Also updates .gitignore to ignore installed
lua files but not files in a 'lua/' subdirectory.

Signed-off-by: Michael Maurer <[email protected]>
  • Loading branch information
maurermi authored and HalosGhost committed Apr 19, 2024
1 parent 84db009 commit f805c64
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
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

0 comments on commit f805c64

Please sign in to comment.