-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlatency_test_sh.sh
54 lines (42 loc) · 882 Bytes
/
latency_test_sh.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
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# helper fun to emphasize a string by making it yellow
function make_yellow {
echo "\e[93m${1}\e[0m"
}
# parse vars loop
for i in "$@"
do
case $i in
--maxreq=*)
MAXREQ="${i#*=}"
shift
;;
--concmin=*)
CONCMIN="${i#*=}"
shift
;;
--concmax=*)
CONCMAX="${i#*=}"
shift
;;
--concby=*)
CONCBY="${i#*=}"
shift
;;
--testurl=*)
TESTURL="${i#*=}"
shift
;;
*)
;;
esac
done
# construct array of concurrencies
CONCS=$(seq ${CONCMIN} ${CONCBY} ${CONCMAX})
# execute js script for each
for conc in ${CONCS}
do
# maybe add check if colours defined in all universally possible terminals?
echo -e "Latency test on '${TESTURL}' with $(make_yellow ${conc}) concurrent calls until ${MAXREQ} total requests fired."
node latency_test_js.js ${MAXREQ} ${conc} ${TESTURL}
done