home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ptdem3.zip / FCSAMP.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  3KB  |  114 lines

  1. /***************************************/
  2. /* Pegasus Log Rexx Extension          */
  3. /* Version 1.0                         */
  4. /* (c) 1993,1994 C.O.L. Systems Inc.   */
  5. /* All Rights Reserved                 */
  6. /* FAT Cache Sample Proc               */
  7. /***************************************/
  8.  
  9. Data1. = "";         /* This is our data stem. Assumes one file input*/
  10.  
  11. Parse Arg   MyFile   /* Parse the file name on input to the proc     */
  12.  
  13. /************************/
  14. /* Load the extension   */
  15. /************************/
  16.  
  17. if RxFuncQuery('PegLoadFunctions') <> 0 then do
  18.    rcy = RxFuncAdd('PegLoadFunctions','PEGREXX','PegLoadFunctions')
  19.    if rcy = 0 then do
  20.       rcy = PegLoadFunctions()
  21.       if rcy > 0 then
  22.          signal BadLoad;
  23.       end;
  24.    else do
  25.       signal BadAdd;
  26.       end;
  27.    end;
  28.  
  29. /**************************/
  30. /* Load the file and stem */
  31. /**************************/
  32.  
  33. rcx = PegLoadFile(MyFile,"Data1.");
  34.  
  35. /***************************/
  36. /* Check that the file was */
  37. /* loaded ok and the app   */
  38. /* that created the log    */
  39. /* is CacheMon             */
  40. /***************************/
  41.  
  42. if rcx == 0 & Data1.Creator == 3 then do
  43.  
  44.    /* Copyright information   */
  45.  
  46.    say;
  47.    do count = 1 to 7
  48.       say   sourceline(count);
  49.       end;
  50.  
  51.    /* Supplied by originator  */
  52.  
  53.    say;
  54.    say "Data was created by "Data1.Title;   
  55.  
  56.    /* For each resource found flag, display the name  */
  57.  
  58.    say "Res # = "Data1.Resources;   
  59.  
  60.    do count = 1 to Data1.Resources  /* Display each on in list */
  61.       say   "Resource "count" = "Data1.Resources.count;
  62.       end
  63.  
  64.    /* Display the number of records */
  65.    say   "Records = "Data1.Records; 
  66.  
  67.    /* Loop through record count and show fat cache information */
  68.  
  69.    if( Data1.Records > 0 ) then do
  70.       do count = 1 to Data1.Records
  71.          if Data1.Records.count.FC then do
  72.             say   PegDate('U',Data1.Records.count.TDS)" ",
  73.                   PegTime('N',Data1.Records.count.TDS),
  74.                   "R-Hit  = "format(Data1.Records.count.FC.ctReadHit,4),
  75.                   "R-Miss = "format(Data1.Records.count.FC.ctReadMiss,4),
  76.                   "W-Hit  = "format(Data1.Records.count.FC.ctWriteHit,4),
  77.                   "W-Miss = "format(Data1.Records.count.FC.ctWriteMiss,4);
  78.             end;
  79.          end;
  80.       end;
  81.    end;
  82.  
  83. /* Report a file access error  */
  84.  
  85. else do
  86.    if rcx > 0 then
  87.       say "Error in file set = "rcx;
  88.    else
  89.       say "This log file was not created with CacheMon!";
  90.    end;
  91.  
  92. /* Release the extension   */
  93.  
  94. rcx = PegDropFunctions();
  95. call RXFUNCDROP 'PEGLOADFUNCTIONS';
  96.  
  97. exit;
  98.  
  99. /****************************************************/
  100. /*  Error in syntax occured somewhere here          */
  101. /****************************************************/
  102.  
  103. BadAdd:
  104.  
  105.    say   'Error Adding Pegasus Rexx Function Loader';
  106.  
  107. exit;
  108.  
  109. BadLoad:
  110.  
  111.    say   'Error Loading Pegasus Rexx Functions';
  112.  
  113. exit;
  114.