forked from etsangsplk/hello-retail
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmeta-run.sh
55 lines (52 loc) · 1.61 KB
/
meta-run.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
54
55
#!/bin/bash
set -e
export EXP_NAMES=()
export EXP_MEMORY_SIZES=()
export EXP_DURATIONS=()
export EXP_LOADS=()
export EXP_REPETITION_COUNTS=()
export EXP_THREAT_COUNTS=()
export EXP_COUNTS=()
export EXP_REGIONS=()
for filename in measurementplans/*.json; do
EXP_NAMES+=($(jq -r '.name' $filename))
EXP_MEMORY_SIZES+=($(jq -r '.memSize' $filename))
EXP_DURATIONS+=($(jq -r '.duration' $filename))
EXP_LOADS+=($(jq -r '.load' $filename))
EXP_REPETITION_COUNTS+=($(jq -r '.repetitions' $filename))
EXP_THREAT_COUNTS+=($(jq -r '.loadriverthreats' $filename))
EXP_REGIONS+=($(jq -r '.region' $filename))
EXP_COUNTS+=( 1 )
done
max=${EXP_REPETITION_COUNTS[0]}
for n in "${EXP_REPETITION_COUNTS[@]}" ; do
((n > max)) && max=$n
done
echo "Maximum number of runs: $max"
for ((i=1;i<=$max;i++));
do
indexes=( $(shuf -e "${!EXP_NAMES[@]}") )
for index in "${indexes[@]}"; do
if [ ${EXP_COUNTS[$index]} -le ${EXP_REPETITION_COUNTS[$index]} ]
then
export EXP_NAME=${EXP_NAMES[$index]}
export EXP_MEMORY_SIZE=${EXP_MEMORY_SIZES[$index]}
export EXP_DURATION=${EXP_DURATIONS[$index]}
export EXP_LOAD=${EXP_LOADS[$index]}
export EXP_THREATS=${EXP_THREAT_COUNTS[$index]}
export EXP_REPETITION=${EXP_COUNTS[$index]}
export EXP_REGION=${EXP_REGIONS[$index]}
EXP_COUNTS[$index]=$(( ${EXP_COUNTS[$index]}+1 ))
echo "---"
echo ${EXP_NAME}
echo ${EXP_MEMORY_SIZE}
echo ${EXP_DURATION}
echo ${EXP_LOAD}
echo ${EXP_THREATS}
echo ${EXP_REPETITION}
echo ${EXP_REGION}
echo "---"
./run.sh
fi
done
done