From 03cedde512a6306a7b68826f3b3d64e6dbe256b7 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 17 Mar 2010 13:53:48 +0100 Subject: [PATCH] script to generate stat data from timed client runs --- perf/bash/stat_file.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 perf/bash/stat_file.sh diff --git a/perf/bash/stat_file.sh b/perf/bash/stat_file.sh new file mode 100644 index 0000000..20452bf --- /dev/null +++ b/perf/bash/stat_file.sh @@ -0,0 +1,24 @@ + +FILE=timed.$1.log +TEMP=${FILE/timed./} +USERS=${TEMP/.log/} +#echo $USERS $FILE + +stat_word () { + WORD=$1 + NUMBERS=`grep $WORD $FILE | cut -d , -f 3` +# echo NUMBERS $NUMBERS + SUM=`(for d in $NUMBERS ; do echo " $d + " ; done ; echo "0" ) ` + SUM=`echo $SUM | bc` +# echo SUM $SUM + COUNT=`(for d in $NUMBERS ; do echo " 1 + " ; done ; echo "0")` + COUNT=`echo $COUNT | bc` +# echo COUNT $COUNT + AVG=`echo "scale=3; $SUM / ($COUNT) " | bc` + echo "$AVG" +} + +INIT=`stat_word "init" ` +SEARCH=`stat_word "search"` +SHOW=`stat_word "show"` +echo "$USERS $INIT $SEARCH $SHOW" -- 1.7.10.4