#! /bin/sh
#
# $Id$
# Use our pathname to locate the absolute path for our awk scripts.
t=`dirname $0`
h=`(cd $t && echo $PWD)`
# We need a temporary file, and we need to clean it up after failure.
tmp="$PWD/__t"
trap 'rm -f $tmp; exit 1' 1 2 3 13 15
trap 'rm -f $tmp; exit 0' 0
# header --
# Output HTML page header.
# $1: directory name.
header()
{
echo ""
echo "
"
machine=`echo $1 | sed 's/.*\.//'`
echo "Berkeley DB test_micro run: $machine"
echo ""
echo ""
echo "Berkeley DB test_micro run: $machine
"
echo "`date`
"
test -f UNAME && cat UNAME
}
# footer --
# Output HTML page footer.
footer()
{
echo ""
echo ""
}
# table --
# Create a table.
# $1: output file
table()
{
title="Test $1: `egrep '^#' $1 | sort -u | sed 's/^#[ ]*//'`"
echo "
"
echo ""
echo "$title | "
echo ""
echo "Release | "
echo "Operations/second | "
echo "
"
# You can set the MAJOR and MINOR environment variables to limit
# the BDB releases for which a report is created.
#
# Process the output into a single line per release.
egrep "^${MAJOR:-[0-9][0-9]*}.${MINOR:-*}" $1 |
awk -f $h/report.awk |
sort -n > $tmp
# Get the release count, and maximum value.
nrel=`wc -l $tmp`
max=`sort -k 2 -n -t ":" < $tmp | tail -1 | awk -F: '{print $2}'`
# Display the output.
IFS=":"
cat $tmp | while true; do
# release, average, runs, percent, standard deviation
read rel avg runs percent rsd
if test "X$rel" = "X" ; then
break;
fi
# echo "read: rel $rel, avg $avg, runs $runs, percent $percent, rsd $rsd" > /dev/stderr
echo ""
echo "$rel | "
echo ""
echo ""
echo ""
if [ "$max" = "0.00" ];then
t=0
else
t=`echo "400 * ($avg/($max + $max/10))" | bc -l`
fi
t=`printf %.0f $t`
echo " | "
t=`echo "400 - $t" | bc`
echo " | "
echo " | "
echo "$avg | "
if test "X$percent" != "X" -o "X$rsd" != "X"; then
echo -n " ("
if test "X$percent" = "X"; then
echo -n '***'
else
echo -n "-$percent"
fi
if test "X$rsd" != "X"; then
echo -n ", $rsd rsd, $runs runs"
fi
echo ") | "
fi
echo " "
echo " "
echo " |
"
done
echo "
"
}
for i in RUN.*; do
echo "Building $i..."
name=`echo $i | sed 's/RUN.//'`
(cd $i
header $i
for j in `ls [0-9]* | sort -n`; do
table $j
done
footer) > $i/$name.html
done
exit 0