From: Dennis Schafroth Date: Tue, 4 May 2010 20:20:43 +0000 (+0200) Subject: Generate init,search,show stats from timed log X-Git-Tag: v1.4.1~36 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=6472fde9004fecadd4b9674e18baac5c9e4b81be;p=pazpar2-moved-to-github.git Generate init,search,show stats from timed log --- diff --git a/perf/bash/stat_file.sh b/perf/bash/stat_file.sh index 20452bf..14e164a 100644 --- a/perf/bash/stat_file.sh +++ b/perf/bash/stat_file.sh @@ -1,8 +1,4 @@ -FILE=timed.$1.log -TEMP=${FILE/timed./} -USERS=${TEMP/.log/} -#echo $USERS $FILE stat_word () { WORD=$1 @@ -18,7 +14,22 @@ stat_word () { echo "$AVG" } -INIT=`stat_word "init" ` -SEARCH=`stat_word "search"` -SHOW=`stat_word "show"` -echo "$USERS $INIT $SEARCH $SHOW" +SERVICE=perf_t +if [ "$2" != "" ] ; then + SERVICE=$2 +fi +FILE=timed.$SERVICE.$1.log +USERS=$1 +if [ -f $FILE ] ; then + INIT=`stat_word "init" ` + grep init $FILE | sed -e "s/^.*,/$USERS /" >> init.stat + SEARCH=`stat_word "search"` + grep search $FILE | sed -e "s/^.*,/$USERS /" >> search.stat + SHOW=`stat_word "show"` + grep show $FILE | sed -e "s/^.*,/$USERS /" >> show.stat + + echo "$1 $INIT $SEARCH $SHOW" +else + echo "# no such file $FILE" +fi +