forked from gluster/gluster-performance-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract-smallfile-results.sh
executable file
·23 lines (18 loc) · 1.01 KB
/
extract-smallfile-results.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
if [ $# -ne 1 ]
then
echo; echo "Usage: $0 <result to be analyzed> "
echo; echo "eg:"
echo; echo " # $0 fuse-mount-small-file-result.txt "
exit
fi
Operations=( "create" "ls-l" "chmod" "stat" "read" "append" ": rename" "delete-renamed" "mkdir" "rmdir" "cleanup" )
for (( i = 0; i < ${#Operations[@]} ; i++ ))
do
if [ "${Operations[$i]}" = "read" -o "${Operations[$i]}" = "delete-renamed" -o "${Operations[$i]}" = "mkdir" -o "${Operations[$i]}" = "rmdir" ]
then
egrep -i "operation|^files/sec" $1 | grep -A 1 -i "${Operations[$i]}" | grep -i files | awk -v ops=$(echo "${Operations[$i]}" | tr -d ' :') -v PREC=100 -v CONVFMT=%.17g 'BEGIN{ sum = 0} {sum+=sprintf("%f",$3)} END{print ops ": " sum/NR}'
else
egrep -i "operation|^files/sec" $1 | grep -A 1 -i "${Operations[$i]}" | grep -i files | tail -n +2 | awk -v ops=$(echo "${Operations[$i]}" | tr -d ' :') -v PREC=100 -v CONVFMT=%.17g 'BEGIN{ sum = 0} {sum+=sprintf("%f",$3)} END{print ops ": " sum/NR}'
fi
done