-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_locust.sh
executable file
·43 lines (33 loc) · 1.24 KB
/
start_locust.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# abort if any command returns a non-zero error code
set -e
BASEDIR=$(pwd)
FIXTURE_DIR="${BASEDIR}/fixtures"
FIXTURE_DATA_CREATION_DIR="${FIXTURE_DIR}/dataCreation"
LOCUST_DIR="${BASEDIR}/bleth"
WALLET_FILE="${LOCUST_DIR}/wallets.json"
CONTRACT_FILE="${LOCUST_DIR}/token.json"
TRANSACTIONS_FILE="${LOCUST_DIR}/tx_out.json"
if [ -z "$1" ]; then
echo "No argument supplied, please supply a tag to execute from the list [ call, estimategas, gasprice, unclecount, txcountbynumber, txcount, getcode, getstorageat, getbalance, getblockbynumber, getlogs, gasprice, txbyhash ]"
exit 1
fi
if [ ! -f "${WALLET_FILE}" ]; then
echo "${WALLET_FILE} not found... generate the data by running benchmark.sh"
exit 1
fi
if [ ! -f "${CONTRACT_FILE}" ]; then
echo "${CONTRACT_FILE} not found... generate the data by running benchmark.sh"
exit 1
fi
if [ ! -f "${TRANSACTIONS_FILE}" ]; then
echo "${TRANSACTIONS_FILE} not found... generate the data by running benchmark.sh"
exit 1
fi
echo "preparing the benchmark..."
HOST=$(expr substr $(grep "NGINX_HTPASSWD=" "${FIXTURE_DATA_CREATION_DIR}/.env") 16 64)
echo "building locust..."
cd "${LOCUST_DIR}"
./build.sh
echo "starting locust with tag ${1}..."
./locust.sh "${HOST}@127.0.0.1/dev1/ethv1" "${1}"