home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / byteunix.lzh / byte.1 / fs.awk < prev    next >
Text File  |  1990-05-11  |  2KB  |  72 lines

  1. ###############################################################################
  2. #  The BYTE UNIX Benchmarks - Release 2
  3. #          Module: fs.awk   SID: 2.5 4/17/90 16:45:40
  4. #          
  5. ###############################################################################
  6. # Bug reports, patches, comments, suggestions should be sent to:
  7. #
  8. #    Ben Smith or Rick Grehan at BYTE Magazine
  9. #    ben@bytepb.UUCP    rick_g@bytepb.UUCP
  10. #
  11. ###############################################################################
  12. #  Modification Log:
  13. #       added geometric mean 8/6/89 -ben
  14. #       modified for new version of fstime 11/15/89
  15. #
  16. ###############################################################################
  17. BEGIN   { w_product = 0.0000;
  18.     r_product = 0.0000;
  19.     c_product = 0.0000;
  20.     iter=0;
  21.     w_too_quick=0;
  22.     r_too_quick=0;
  23.     c_too_quick=0;
  24.     }
  25. /real/    { iter++; ok++; next; }
  26. /user/    { next; }
  27. /sys/    { next; }
  28. /^$/    { next; } 
  29. /fstime/ {
  30.          print "** Iteration ",iter," Failed: ",$0; 
  31.      ok--;
  32.          fail=1;
  33.          } 
  34. /write/ { if (!fail) {
  35.            w+=$1;
  36.            w2+=$1*$1;
  37.            w_product += log($1); 
  38.            }
  39.         }
  40. /read/  { if (!fail) {
  41.            r+=$1;
  42.            r2+=$1*$1;
  43.            r_product += log($1); 
  44.            }
  45.         }
  46. /copy/  { if (!fail) {
  47.            c+=$1;
  48.            c2+=$1*$1;
  49.            c_product += log($1);
  50.            }
  51.     }
  52. END {
  53.     if (ok != iter) {
  54.        printf "For %d successful iterations from %d attempts ...\n",ok,iter;
  55.     }
  56.     if (ok > 0) {
  57.         printf "                       Arithmetric        Geometric         Variance\n";
  58.         printf "                              Mean             Mean         (%d tests)\n",ok
  59.         printf "Read (Kbytes/sec):        %9.0f        %9.0f         ",r/ok,exp(r_product/ok);
  60.         if (ok > 1) printf "%9.2f\n",(r2-r*r/ok)/(ok-1);
  61.         else printf "n/a\n"
  62.         printf "Write (Kbytes/sec):       %9.0f        %9.0f         ",w/ok,exp(w_product/ok);
  63.         if (ok > 1) printf "%9.2f\n",(w2-w*w/ok)/(ok-1);
  64.         else printf "n/a\n"
  65.         printf "Copy (Kbytes/sec):        %9.0f        %9.0f         ",c/ok,exp(c_product/ok);
  66.         if (ok > 1) printf "%9.2f\n",(c2-c*c/ok)/(ok-1);
  67.         else printf "n/a\n"
  68.     } else {
  69.         print "-- no measured results --"
  70.     }
  71.     }
  72.