home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / musbus / part02 / fs.awk < prev    next >
Encoding:
Text File  |  1987-09-16  |  988 b   |  30 lines

  1. # $Header: fs.awk,v 3.4 87/06/22 14:27:32 kjmcdonell Beta $
  2. /real/    { next }
  3. /^[0-9][ .0-9]*$/ && NF==3 {
  4.     if (!fail) {
  5.         w+=$1; w2+=$1*$1; r+=$2; r2+=$2*$2; c+=$3; c2+=$3*$3; ok++
  6.     }
  7.     fail=0; iter++; next
  8.     }
  9.     { print "** Iteration ",iter+1," Failed: ",$0; fail=1; }
  10. END {
  11.     if (fail) iter++
  12.     if (ok != iter) {
  13.         printf "For %d successful iterations from %d attempts ...\n",ok,iter
  14.         iter=ok
  15.     }
  16.     if (iter > 0) {
  17.         printf "Write: %.1f Kbytes per second  ",w/iter
  18.         if (iter > 1) printf " (variance %.1f)",(w2-2*w*w/iter+w*w/iter)/(iter-1)
  19.         printf "\nRead:  %.1f Kbytes per second  ",r/iter
  20.         if (iter > 1) printf " (variance %.1f)",(r2-2*r*r/iter+r*r/iter)/(iter-1)
  21.         printf "\nCopy:  %.1f Kbytes per second  ",c/iter
  22.         if (iter > 1) printf " (variance %.1f)",(c2-2*c*c/iter+c*c/iter)/(iter-1)
  23.         print
  24.     } else {
  25.         print "Write: -- no measured results!!"
  26.         print "Read: -- no measured results!!"
  27.         print "Copy: -- no measured results!!"
  28.     }
  29.     }
  30.