summaryrefslogtreecommitdiff
path: root/ezbench.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-19 19:06:37 +0100
committerMartin Peres <martin.peres@linux.intel.com>2015-07-20 14:11:18 +0300
commit225e3c300605394e2c73fb6ab0a8e97ca7231f4f (patch)
tree1b77c6191593ecad492585395ef6da361e9a1bdf /ezbench.sh
parent6ed9dea37f98cf11e30696844fdf5d5b03107cba (diff)
Finish each commit by showing the geometric mean
The geometric mean helps to summarise all of the individual tests into a single traffic.
Diffstat (limited to 'ezbench.sh')
-rwxr-xr-xezbench.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/ezbench.sh b/ezbench.sh
index a359bd3..9a2a580 100755
--- a/ezbench.sh
+++ b/ezbench.sh
@@ -139,6 +139,7 @@ typeset -A testNames
typeset -A testPrevFps
i=0
total_round_time=0
+testPrevFps[-1]=-1
echo -n "Tests that will be run: "
for test_file in $ezBenchDir/tests.d/*.test
do
@@ -185,6 +186,7 @@ callIfDefined ezbench_pre_hook
c_bright_red='\e[1;31m'
c_bright_green='\e[1;32m'
c_bright_yellow='\e[1;33m'
+c_bright_white='\e[1;37m'
c_reset='\e[0m'
bad_color=$c_bright_red
@@ -269,7 +271,30 @@ do
color="$meh_color"
fi
printf "%9.2f ($color%+.2f%%$c_reset): %s\n" $fpsTest $fpsDiff "$remStatsTest"
+ fpsALL="$fpsALL $fpsTest"
done
+
+ # finish with the geometric mean (when we have multiple tests)
+ if [ $t -gt 1 ]; then
+ fpsALL=$(echo $fpsALL | awk '{ for (i=1; i <= NF; i++) { sum += 1/$i; n += 1 } } END { print n / sum }')
+ if (( $(echo "${testPrevFps[-1]} == -1" | bc -l) ))
+ then
+ testPrevFps[-1]=$fpsALL
+ fi
+ fpsDiff=$(echo "scale=3;($fpsALL * 100.0 / ${testPrevFps[-1]}) - 100" | bc)
+ testPrevFps[-1]=$fpsALL
+ if (( $(bc -l <<< "$fpsDiff < -1.5") == 1 )); then
+ color=$bad_color
+ elif (( $(bc -l <<< "$fpsDiff > 1.5") == 1 )); then
+ color=$good_color
+ else
+ color="$meh_color"
+ fi
+ printf "$c_bright_white%28s: %9.2f ($color%+.2f%%$c_bright_white)$c_reset\n" \
+ "geometric mean" \
+ $fpsALL \
+ $fpsDiff
+ fi
echo
done