From: Dennis Schafroth Date: Wed, 17 Mar 2010 12:53:48 +0000 (+0100) Subject: script to generate stat data from timed client runs X-Git-Tag: v1.4.0~67^2~4 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=946a54a553c226fe8a56909acb92410640455ad9;p=pazpar2-moved-to-github.git script to generate stat data from timed client runs --- 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"