From db468693ef5faa294d9bc3cd3c5d70c0d99d488b Mon Sep 17 00:00:00 2001 From: Rahul C S Date: Fri, 17 Feb 2012 17:23:28 +0530 Subject: Adding the performance framework to the qa repo Change-Id: Ia7dbd82e9bb2e5e65e9345234ce34f8518a091ad Signed-off-by: Rahul C S --- perf-framework/calc_avg | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 perf-framework/calc_avg (limited to 'perf-framework/calc_avg') diff --git a/perf-framework/calc_avg b/perf-framework/calc_avg new file mode 100755 index 0000000..596554f --- /dev/null +++ b/perf-framework/calc_avg @@ -0,0 +1,54 @@ +#!/bin/bash -ue + +egrep_patt="" +num="" +for run in "$@" +do + egrep_patt+="^`echo run$run\|`" + PERFLOG="log_repo/run$run/client/perf-test.log" + if [ $run -lt 9 ] + then + run="0$run" + fi + echo "RUN$run" > /tmp/run$run.$$ + echo "-------" >> /tmp/run$run.$$ + for op in `cat ops` + do + time=0; + for i in `grep -w ^$op $PERFLOG | awk '{print $2}'| cut -f1 -d'.'` + do + time=$((time+$i)) + done; + time=$((time/3)) # Average over three runs + echo $time >> /tmp/run$run.$$ + done +done +egrep_patt+="^zzz" + +echo "" +egrep -w "$egrep_patt" log_repo/runlog +echo "" +echo "Operations " > /tmp/tmp_ops.$$ +echo "-------------------------" >> /tmp/tmp_ops.$$ +awk '{ printf("%-25s\n", $0) }' ops >> /tmp/tmp_ops.$$ + +if [ $# -lt 2 ]; then + paste /tmp/tmp_ops.$$ /tmp/run*.$$; +else + for list in "$@"; do + if [ $list -lt 9 ]; then + list="0$list" + fi + if [ "$1" -eq $list ]; then + num="{$list" + else + num="$num,$list"; + fi + + if [ "${@: -1}" -eq $list ]; then + num="$num}" + fi + done + eval "paste /tmp/tmp_ops.$$ /tmp/run$num.$$"; +fi +rm /tmp/run*.$$ /tmp/tmp_ops.$$ -- cgit