#!/bin/bash
# Run the locust master on current host, waiting for specified number of 
# slaves to connect.
function bail () { echo -e "\nError: ${1:-Unknown Error}\n"; exit ${2:-1}; }
export P4BENCH_NUM_HOSTS=${P4BENCH_NUM_HOSTS:-Undefined}
export P4BENCH_NUM_HOSTS=${1:-$P4BENCH_NUM_HOSTS}
[[ $P4BENCH_NUM_HOSTS == Undefined ]] && \
   bail "Num_hosts parameter not supplied."
export P4BENCH_NUM_SLAVES_PER_HOST=${P4BENCH_NUM_SLAVES_PER_HOST:-Undefined}
export P4BENCH_NUM_SLAVES_PER_HOST=${2:-$P4BENCH_NUM_SLAVES_PER_HOST}
[[ $P4BENCH_NUM_SLAVES_PER_HOST == Undefined ]] && \
   bail "Num_slaves parameter not supplied."
export P4BENCH_SCRIPT=${P4BENCH_SCRIPT:-Undefined}
export P4BENCH_SCRIPT=${3:-$P4BENCH_SCRIPT}
[[ $P4BENCH_SCRIPT == Undefined ]] && \
   bail "Benchmark script parameter not supplied."
total_slaves=$(($P4BENCH_NUM_HOSTS * $P4BENCH_NUM_SLAVES_PER_HOST))
pkill -9 locust
nohup locust -f locust_files/p4_$P4BENCH_SCRIPT.py --master --no-web --expect-slaves=$total_slaves -c $total_slaves -r $total_slaves > master.out 2>&1 &
                    | # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #8 | 25529 | Robert Cowham | 
                    Latest copy of files including docker compose setup. Merging //guest/robert_cowham/p4benchmark/pb/... to //guest/robert_cowham/p4benchmark/main/...  | 
                ||
| #7 | 24851 | Robert Cowham | 
                    Improve sql reporting. Log ps usage  | 
                ||
| #6 | 24747 | Robert Cowham | Full parameterised - runs syncbench at least | ||
| #5 | 24745 | Robert Cowham | Use global vars in hosts file | ||
| #4 | 24728 | Robert Cowham | Rename config files. | ||
| #3 | 24711 | Robert Cowham | Restructure and tidy up | ||
| #2 | 24687 | Robert Cowham | Got analysis working | ||
| #1 | 21767 | Robert Cowham | add latest stuff with analyse |