Skip to content

Commit

Permalink
runner.sh: Add -e flag for testing external network
Browse files Browse the repository at this point in the history
With `-e` flag only bench container will be started. `-a` flag should be
 used with `-e` flag for specifying external RPC address.

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed May 4, 2024
1 parent 7a39b3f commit dbed21f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ The following default configurations are available:
Example: -l journald -l syslog -l json-file
--tc Arguments to pass to 'tc qdisc netem' inside the container.
Example: 'delay 100ms'
-e, --external Use external network for benchmarking. Default is false.
```

Expand Down
15 changes: 11 additions & 4 deletions runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COUNT=""
IR_TYPE=go
RPC_TYPE=
RPC_ADDR=()
EXTERNAL_NETWORK=false
export NEOBENCH_LOGGER=${NEOBENCH_LOGGER:-none}
export NEOBENCH_TYPE=${NEOBENCH_TYPE:-NEO}
export NEOBENCH_FROM_COUNT=${NEOBENCH_FROM_COUNT:-1}
Expand Down Expand Up @@ -51,6 +52,7 @@ show_help() {
echo " Example: -l journald -l syslog -l json-file"
echo " --tc Arguments to pass to 'tc qdisc netem' inside the container."
echo " Example: 'delay 100ms'"
echo " -e, --external Use external network for benchmarking. Default is false."
exit 0
}

Expand All @@ -69,6 +71,9 @@ while test $# -gt 0; do

case $_opt in
-h | --help) show_help ;;
-e|--external)
EXTERNAL_NETWORK=true
;;
-l | --log)
if [[ $# -gt 0 && ${1:0:1} != "-" ]]; then
case "$1" in
Expand Down Expand Up @@ -264,7 +269,9 @@ if [ -n "$NEOBENCH_VOTE" ]; then
fi

make prepare

docker compose "${FILES[@]}" run bench neo-bench -o "$OUTPUT" "${ARGS[@]}"

make stop
if [ "$EXTERNAL_NETWORK" = true ]; then
docker compose -f .docker/rpc/docker-compose.bench.yml run --rm base-bench neo-bench -o "$OUTPUT" "${ARGS[@]}"
else
docker compose "${FILES[@]}" run bench neo-bench -o "$OUTPUT" "${ARGS[@]}"
make stop
fi

0 comments on commit dbed21f

Please sign in to comment.