Skip to content

Commit

Permalink
runner.sh: transform boolean --log flag to string flag
Browse files Browse the repository at this point in the history
For MacOS NEOBENCH_LOGGER should be set to json-file as journald and
syslog are not supported by this architecture.

Close #159

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed May 2, 2024
1 parent aec270b commit a8421b9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,17 @@ The following default configurations are available:
## Runner usage (`./runner.sh`)

```
-v, --validators Consensus node count.
Possible values: 1, 4 (default), 7.
-n, --nodes Consensus node type.
Possible values: go (default), mixed, sharp.
-r, --rpc RPC node type. Default is the same as --nodes.
-h, --help Show usage message.
-b, --benchmark Benchmark type.
Possible values: NEO (default) or GAS
--from Number of tx senders (default: 1)
--to Number of fund receivers (default: 1)
--vote Whether or not candidates should be voted for before the bench.
-d Benchmark description.
-m Benchmark mode.
Example: -m wrk -m rate
Expand All @@ -282,6 +292,11 @@ The following default configurations are available:
-t Request timeout.
Used for RPC requests.
Example: -t 30s
-l, --log Container logging facility. Default value is none.
Example: -l journald -l syslog -l json-file
--tc Arguments to pass to 'tc qdisc netem' inside the container.
Example: 'delay 100ms'
```

## Build options
Expand Down Expand Up @@ -410,14 +425,16 @@ To add one more node configuration, provide all necessary information to the `no

Name|Description| Default |Example
---|---|---------|---
NEOBENCH_LOGGER|Container logging facility| `none` |`none`, `journald`, `syslog`
NEOBENCH_LOGGER|Container logging facility| `none` |`none`, `journald`, `syslog`,`json-file`
NEOBENCH_TC|Parameters passed to the `tc qdisc` (netem discipline) on container startup| |`delay 100ms`
NEOBENCH_TYPE|Type of the load| `NEO` |`NEO`, `GAS`
NEOBENCH_FROM_COUNT|Number of tx senders| `1` | `1`
NEOBENCH_TO_COUNT|Number of fund receivers| `1` | `1`
NEOBENCH_VALIDATOR_COUNT|Number of validators| `4` | `1`, `4`, `7`
NEOBENCH_VOTE|Vote for validators before the bench| empty |`1` or empty

For MacOS NEOBENCH_LOGGER should be set to `json-file` as `journald` and
`syslog` are not supported by this architecture.
## Benchmark results visualisation

There's a Python plotting script available for benchmark data visualisation.
Expand Down
20 changes: 18 additions & 2 deletions runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ show_help() {
echo " -t Request timeout."
echo " Used for RPC requests."
echo " Example: -t 30s"
echo " -l, --log Enable logging on consensus nodes."
echo " -l, --log Container logging facility. Default value is none."
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'"
exit 0
Expand All @@ -68,7 +69,22 @@ while test $# -gt 0; do

case $_opt in
-h | --help) show_help ;;
-l | --log) export NEOBENCH_LOGGER=journald ;;
-l | --log)
if [[ $# -gt 0 && ${1:0:1} != "-" ]]; then
case "$1" in
"syslog" | "journald" | "json-file" | "none")
export NEOBENCH_LOGGER="$1"
shift
;;
*)
fatal "unknown logger specified: $1"
;;
esac
else
export NEOBENCH_LOGGER="none"
fi
;;

--vote) export NEOBENCH_VOTE=1 ;;

-v | --validators)
Expand Down

0 comments on commit a8421b9

Please sign in to comment.