| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # $Id$ |
| 4 | |
| 5 | # Use our pathname to locate the absolute path for our awk scripts. |
| 6 | t=`dirnamescip-shell system . . dirname. $0` |
| 7 | h=`(cd $t && echoscip-shell system . . echo. $PWD)` |
| 8 | |
| 9 | # We need a temporary file, and we need to clean it up after failure. |
| 10 | tmp="$PWD/__t" |
| 11 | trap 'rm -f $tmp; exit 1' 1 2 3 13 15 |
| 12 | trap 'rm -f $tmp; exit 0' 0 |
| 13 | |
| 14 | # header -- |
| 15 | # Output HTML page header. |
| 16 | # $1: directory name. |
| 17 | headerscip-shell shell db5.3 5.3.28+dfsg2-11 header().() |
| 18 | { |
| 19 | echoscip-shell system . . echo. "<html>" |
| 20 | echoscip-shell system . . echo. "<head>" |
| 21 | machine=`echoscip-shell system . . echo. $1 | sedscip-shell system . . sed. 's/.*\.//'` |
| 22 | echoscip-shell system . . echo. "<title>Berkeley DB test_micro run: $machine</title>" |
| 23 | echoscip-shell system . . echo. "</head>" |
| 24 | echoscip-shell system . . echo. "<body bgcolor=white>" |
| 25 | echoscip-shell system . . echo. "<center><h1>Berkeley DB test_micro run: $machine</h1></center>" |
| 26 | echoscip-shell system . . echo. "<p align=right>`datescip-shell system . . date.`</p>" |
| 27 | testscip-shell system . . test. -f UNAME && catscip-shell system . . cat. UNAME |
| 28 | } |
| 29 | |
| 30 | # footer -- |
| 31 | # Output HTML page footer. |
| 32 | footerscip-shell shell db5.3 5.3.28+dfsg2-11 footer().() |
| 33 | { |
| 34 | echoscip-shell system . . echo. "</body>" |
| 35 | echoscip-shell system . . echo. "</html>" |
| 36 | } |
| 37 | |
| 38 | # table -- |
| 39 | # Create a table. |
| 40 | # $1: output file |
| 41 | tablescip-shell shell db5.3 5.3.28+dfsg2-11 table().() |
| 42 | { |
| 43 | title="Test $1: `egrepscip-shell system . . egrep. '^#' $1 | sortscip-shell system . . sort. -u | sedscip-shell system . . sed. 's/^#[ ]*//'`" |
| 44 | echoscip-shell system . . echo. "<hr size=1 noshade>" |
| 45 | echoscip-shell system . . echo. "<table cellspacing=0 cellpadding=0 border=0>" |
| 46 | echoscip-shell system . . echo. "<th align=left colspan=2>$title</th>" |
| 47 | echoscip-shell system . . echo. "<tr>" |
| 48 | echoscip-shell system . . echo. "<th align=right>Release</th>" |
| 49 | echoscip-shell system . . echo. "<th align=center>Operations/second</th>" |
| 50 | echoscip-shell system . . echo. "</tr>" |
| 51 | |
| 52 | # You can set the MAJOR and MINOR environment variables to limit |
| 53 | # the BDB releases for which a report is created. |
| 54 | # |
| 55 | # Process the output into a single line per release. |
| 56 | egrepscip-shell system . . egrep. "^${MAJOR:-[0-9][0-9]*}.${MINOR:-*}" $1 | |
| 57 | awkscip-shell system . . awk. -f $h/report.awk | |
| 58 | sortscip-shell system . . sort. -n > $tmp |
| 59 | |
| 60 | # Get the release count, and maximum value. |
| 61 | nrel=`wcscip-shell system . . wc. -l $tmp` |
| 62 | max=`sortscip-shell system . . sort. -k 2 -n -t ":" < $tmp | tailscip-shell system . . tail. -1 | awkscip-shell system . . awk. -F: '{print $2}'` |
| 63 | |
| 64 | # Display the output. |
| 65 | IFS=":" |
| 66 | catscip-shell system . . cat. $tmp | while truescip-shell system . . true.; do |
| 67 | # release, average, runs, percent, standard deviation |
| 68 | read rel avg runs percent rsd |
| 69 | if testscip-shell system . . test. "X$rel" = "X" ; then |
| 70 | break; |
| 71 | fi |
| 72 | |
| 73 | # echo "read: rel $rel, avg $avg, runs $runs, percent $percent, rsd $rsd" > /dev/stderr |
| 74 | |
| 75 | echoscip-shell system . . echo. "<tr>" |
| 76 | echoscip-shell system . . echo. "<td align=right width=80><pre>$rel</pre></td>" |
| 77 | echoscip-shell system . . echo. "<td>" |
| 78 | echoscip-shell system . . echo. "<table>" |
| 79 | echoscip-shell system . . echo. "<tr>" |
| 80 | if [scip-shell system . . `[`. "$max" = "0.00" ];then |
| 81 | t=0 |
| 82 | else |
| 83 | t=`echoscip-shell system . . echo. "400 * ($avg/($max + $max/10))" | bc -l` |
| 84 | fi |
| 85 | t=`printfscip-shell system . . printf. %.0f $t` |
| 86 | echoscip-shell system . . echo. "<td bgcolor='#003366' width=$t> </td>" |
| 87 | t=`echoscip-shell system . . echo. "400 - $t" | bc` |
| 88 | echoscip-shell system . . echo. "<td bgcolor='#CCCCCC' width=$t> </td>" |
| 89 | echoscip-shell system . . echo. "<td> </td>" |
| 90 | echoscip-shell system . . echo. "<td align=right width=100><pre>$avg</pre></td>" |
| 91 | if testscip-shell system . . test. "X$percent" != "X" -o "X$rsd" != "X"; then |
| 92 | echoscip-shell system . . echo. -n "<td align=right><pre> (" |
| 93 | if testscip-shell system . . test. "X$percent" = "X"; then |
| 94 | echoscip-shell system . . echo. -n '***' |
| 95 | else |
| 96 | echoscip-shell system . . echo. -n "-$percent" |
| 97 | fi |
| 98 | if testscip-shell system . . test. "X$rsd" != "X"; then |
| 99 | echoscip-shell system . . echo. -n ", $rsd rsd, $runs runs" |
| 100 | fi |
| 101 | echoscip-shell system . . echo. ")</pre></td>" |
| 102 | fi |
| 103 | echoscip-shell system . . echo. "</tr>" |
| 104 | echoscip-shell system . . echo. "</table>" |
| 105 | echoscip-shell system . . echo. "</tr>" |
| 106 | done |
| 107 | echoscip-shell system . . echo. "</table>" |
| 108 | } |
| 109 | |
| 110 | for i in RUN.*; do |
| 111 | echoscip-shell system . . echo. "Building $i..." |
| 112 | name=`echoscip-shell system . . echo. $i | sedscip-shell system . . sed. 's/RUN.//'` |
| 113 | (cd $i |
| 114 | headerscip-shell shell db5.3 5.3.28+dfsg2-11 header(). $i |
| 115 | for j in `lsscip-shell system . . ls. [0-9]* | sortscip-shell system . . sort. -n`; do |
| 116 | tablescip-shell shell db5.3 5.3.28+dfsg2-11 table(). $j |
| 117 | done |
| 118 | footerscip-shell shell db5.3 5.3.28+dfsg2-11 footer().) > $i/$name.html |
| 119 | done |
| 120 | |
| 121 | exit 0 |