home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / x / x11p-13.zip / RCS / x11perfboth,v < prev    next >
Text File  |  1990-01-07  |  1KB  |  66 lines

  1. head     1.1;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @# @;
  6.  
  7.  
  8. 1.1
  9. date     90.01.07.20.24.09;  author joel;  state Exp;
  10. branches ;
  11. next     ;
  12.  
  13.  
  14. desc
  15. @Add ratios to an x11perfcomp outpout
  16. @
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @#!/bin/sh
  26. awk '
  27. /^     1/ && READY == 0 {    printf ("    1   ");
  28.         for (i = 2; i < NF; i++)
  29.             printf ("          %2d        ", i);
  30.         printf ("   Operation\n");
  31.         next;
  32.     }
  33. /^---/    {     printf ("--------");
  34.         for (i = 2; i <= NF; i++)
  35.             printf ("   -----------------");
  36.         printf ("\n");
  37.         READY=1; next;
  38.      }
  39. READY==1 {
  40.         base=$1;
  41.         printf ("%8.1f", base);
  42.         for (i = 2; i < '$1'; i++) {
  43.             if (base == 0)
  44.                 printf ("   %8.1f         ", $i);
  45.             else {
  46.                 rate=$i/base;
  47.                 if (rate < .1)
  48.                     printf ("   %8.1f (%6.3f)", $i, rate);
  49.                 else if (rate < 1000)
  50.                     printf ("   %8.1f (%6.2f)", $i, rate);
  51.                 else
  52.                     printf ("   %8.1f (%6.0f)", $i, rate);
  53.             }
  54.         }
  55.         printf ("   ");
  56.         for (; i <= NF; i++)
  57.         {
  58.             printf ("%s ", $i);
  59.         }
  60.         printf ("\n");
  61.         next;
  62.        }
  63.        { print $0; }
  64. '
  65. @
  66.