home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ptdem3.zip / MEMSAMP.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  3KB  |  119 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. /* MEM 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.    /* Display the number of apps  from APPMON or FILEMON */
  68.    say   "Apps    = "Data1.Records.Applications;
  69.  
  70.    /* Display the number of files from APPMON or FILEMON */
  71.    say   "Files   = "Data1.Records.Files;
  72.  
  73.    /* Loop through record count and show paging information */
  74.  
  75.    if( Data1.Records > 0 ) then do
  76.       do count = 1 to Data1.Records
  77.          if Data1.Records.count.MEM then do
  78.             say  PegTime('N',Data1.Records.count.TDS),
  79.                   "Page In  = "format(Data1.Records.count.MEM.ctSwapIn,4),
  80.                   "Faults   = "format(Data1.Records.count.MEM.ctFaults,4),
  81.                   "Page Out = "format(Data1.Records.count.MEM.ctSwapOut,4),
  82.                   "Discards = "format(Data1.Records.count.MEM.ctDiscard,4);
  83.             end;
  84.          end;
  85.       end;
  86.    end;
  87.  
  88. /* Report a file access error  */
  89.  
  90. else do
  91.    if rcx > 0 then
  92.       say "Error in file set = "rcx;
  93.    else
  94.       say "This log file was not created with CacheMon!";
  95.    end;
  96.  
  97. /* Release the extension   */
  98.  
  99. rcx = PegDropFunctions();
  100. call RXFUNCDROP 'PEGLOADFUNCTIONS';
  101.  
  102. exit;
  103.  
  104. /****************************************************/
  105. /*  Error in syntax occured somewhere here          */
  106. /****************************************************/
  107.  
  108. BadAdd:
  109.  
  110.    say   'Error Adding Pegasus Rexx Function Loader';
  111.  
  112. exit;
  113.  
  114. BadLoad:
  115.  
  116.    say   'Error Loading Pegasus Rexx Functions';
  117.  
  118. exit;
  119.