X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=perf%2Fbash%2Fstat_file.sh;h=14e164af3a5420f43f005d304abb979ff16bddc5;hb=68b7620cc5510380ffbccda64ef28c985cde2fa9;hp=20452bfa17e54bac3401f9472c3ebe5d7ecd8bb2;hpb=946a54a553c226fe8a56909acb92410640455ad9;p=pazpar2-moved-to-github.git 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 +