-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalc_avg
executable file
·36 lines (32 loc) · 899 Bytes
/
calc_avg
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
#!/bin/bash -ue
egrep_patt=""
for run in "$@"
do
egrep_patt+="^`echo run$run\|`"
PERFLOG="log_repo/run$run/client/perf-test.log"
if [ $run -lt 9 ]
then
run="0$run"
fi
echo "RUN$run" > /tmp/run$run.$$
echo "-------" >> /tmp/run$run.$$
for op in `cat ops`
do
time=0;
for i in `grep -w ^$op $PERFLOG | awk '{print $2}'| cut -f1 -d'.'`
do
time=$((time+$i))
done;
time=$((time/3)) # Average over three runs
echo $time >> /tmp/run$run.$$
done
done
egrep_patt+="^zzz"
echo ""
egrep -w "$egrep_patt" log_repo/runlog
echo ""
echo "Operations " > /tmp/tmp_ops.$$
echo "-------------------------" >> /tmp/tmp_ops.$$
awk '{ printf("%-25s\n", $0) }' ops >> /tmp/tmp_ops.$$
paste /tmp/tmp_ops.$$ /tmp/run*.$$
rm /tmp/run*.$$ /tmp/tmp_ops.$$