Skip to content

Commit

Permalink
extras/dialer: allow to seed random
Browse files Browse the repository at this point in the history
Helpful if you want to get the same random numbers in subsequent runs
(e.g. to compare results between branches).
  • Loading branch information
schu committed Feb 8, 2017
1 parent f8cf32c commit c349c16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extras/dialer/dialer
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash
set -eu
if [ $# -lt 1 ]; then
echo "Usage: $0 <ip:port> [<max_dialer>]" >&2
echo "Usage: $0 <ip:port> [<max_dialer> [<random_seed>]]" >&2
exit 1
fi

readonly addr=$1
readonly max_dialer=${2:-50}

if [[ $# -gt 2 ]]; then
RANDOM=$3
fi

dialer=()
# shellcheck disable=SC2154
trap 'echo -n "stopping ... "; for c in "${dialer[@]}"; do docker rm -f "$c" >/dev/null; done; echo "done"' EXIT
Expand Down

0 comments on commit c349c16

Please sign in to comment.