-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiozone_disp.sh
executable file
·71 lines (59 loc) · 1.38 KB
/
iozone_disp.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#ROOT_DIR=$(pwd)
#NEW_LOGS_DIR=${ROOT_DIR}/logs_bz2
#HANDLER_DIR=${ROOT_DIR}/handler_directory
working_dir=${HANDLER_DIR}/$1
if ! [ -d ${working_dir} ] ;then
echo "Working dir ${working_dir} not exist."
exit 1
fi
echo $0 done.
tarball_list_j=$(ls ${NEW_LOGS_DIR}/${1}-*.tar.bz2)
for tarball in ${tarball_list_j}
do
#extract log tarball no dependence on testsutie
mkdir t
pushd t
tar xf ${tarball}
log_dir=`ls -tr | tail -n 1`
rm -rf `ls | grep -v "^${log_dir}$"`
mv ${log_dir} ../
popd
rm -rf t
#remove noused files dependence on testsutie
pushd ${log_dir}
rm -rf `ls | grep -v "^iozone-bigmem-"`
rm -rf iozone-bigmem-abuildinfo
popd
done
#build data_group
new_dir=`pwd`
new_dir_file_list=`ls`
mkdir -pv ${new_dir}/data_group
#x is directory
for x in ${new_dir_file_list}
do
pushd $x
#y is logfile
for y in `ls`
do
mkdir -pv ${new_dir}/data_group/${y}
touch ${new_dir}/data_group/${y}/${y}.${x}
j=1
for i in $(cat ${y} | grep -A 6 '^ *KB' |tail -n 6 | awk '{print $3, $4, $5, $6, $7, $8, $9}');do echo $i >> ${new_dir}/data_group/${y}/${y}.${x}; echo $i >> ${new_dir}/data_group/${y}/line${j};((j++));done
done
popd
done
mkdir -pv ${new_dir}/result
pushd ${new_dir}/data_group
for dir in `ls`
do
pushd $dir
for i in `seq 1 $(($j - 1))`
do
echo `cat line$i | awk '{a+=$1}END{printf("%.1f\n",a/NR)}'` >> ${new_dir}/result/$dir
done
popd
done
popd
exit 0