[324,201] STAT - IAS V3.0 TASK - GENERATE SYSTEM UTILIZATION STATISTICS Submitted by: John Hayes Allen-Bradley NC Systems Division 747 Alpha Drive Cleveland, Ohio 44143 (216) 449-6700 I. DESCRIPTION The files contained in this directory pertain to the generation of system utilization statistics for IAS Version 3.0 and the subsequent analysis of these stats. The STAT program takes a snapshot of the system utilizations values .SSTIM (number of ticks PDS has been active), .SUTIM (number of ticks that the CPU has spent executing user/batch jobs), .SNTIM (number of ticks that the CPU has been idle or waiting for swapping to occur), .SBTIM (number of ticks that the CPU has spent executing batch jobs), and .SPTIM (number of ticks that the CPU has spent waiting for swapping). These values are used to compute 5 new values which break the system statistics down into number of ticks spent exclusively for user, batch, swap, null, and total timesharing time. These computed quantities are output in raw form to the common area STATCM to be used the next time STAT is invoked to calculate the number of ticks used in each category over an incremental period of time. From these newly computed values, a sixth quantity can be determined. This value is the amount of ticks that have been devoted to the execution of real-time tasks which are not handled by the timesharing scheduler. All of the above values, along with the number of terminals currently logged in, are output to the invoking terminal as percent of total time since startup and since the STAT program was last executed. These values are also output to the file LB0:[1,1]STAT.DAT. This provides the user with a record of the output of STAT and allows for further manipulation of the stats (such as plotting the values on a daily, weekly, or monthly basis). At our installation, we invoke the STAT program as a real time task scheduled to run at 15 minute intervals synchronized to the nearest hour. Our PDSSTART.CMD contains the following lines: SCI> INS LB0:[11,1]STAT SCI> RU/SYNC:HOUR/INTERVAL:15M/PRIOR:105 STAT TT0: SCI> RU/DELAY:1M STAT TT0: The reasoning behind running STAT one minute after starting up timesharing is that all of our routines which list/plot the data in STAT.DAT determine if a re-boot has occurred (is this the first line in STAT.DAT or has the number of ticks since PDS startup shown a decrease instead of an increase), and if this is the case, the data on that line is not figured into the statistics. Only the time associated with this first data after re-boot is listed on any associated output. II. FILES IN THIS DIRECTORY AND A DESCRIPTION OF EACH READ.FTN - READ is used to examine the 5 values stored in STATCM. LIST.FTN - LIST is used to print out the values stored in STAT.DAT as percentages (similar to what is output to the invoking terminal) to Fortran logical unit 2. PLOT1.FTN - PLOT1 plots (USER + BATCH)% in an 80 column format using * for incremental values and + for since startup values. The data plotted is taken from STAT.DAT and output to Fortran logical unit 2. PLOT2.FTN - PLOT2 is similar to PLOT1, but in addition to plotting percent utilization PLOT2 plots the number of active terminals (up to 20) in columns 81 to 100. PLOT3.FTN - PLOT3 plots how efficiently you are using your CPU according to the formula (USER+BATCH)/(100%-NULL-SWAP) * 100%. This calculation takes into account only times when the CPU is executing either user or system tasks. The plot produced by PLOT3 gives you some idea how well the system is tuned. In addition to plotting the percent utilization based on the above calculation, PLOT3 also plots the number of active terminals in columns 81 to 100. Note that if NULL time is 100%, the above calculation blows up, so for the sake of argument, when NULL time is equal to 100%, CPU efficiency is 0%. STAT.MAC - STAT is the task which ingests the IAS statistics and spews forth reams of meaningless(ful) data. STATCM.MAC - STATCM is the common area where STAT stores the most recent values it has formed from the IAS stats. WRITE.FTN - WRITE allows the user to examine and modify the contents of the common area STATCM. I just included it for grins. ZERO.FTN - In case you ever get the urge to zero the STATCM common, ZERO gives you the ability to do so. III. IMPLEMENTATION Now that I've totally confused the whole issue, you might wonder, "How the !@#$%^& do I build the thing????" I'm glad you asked. The command file STATBLD.CMD will build and install STATCM, then build STAT. The Fortran programs have individual build files, none of which are at all complicated. If you just want to try out LIST and PLOT1, 2, and 3, I have included a sample of STAT.DAT from our system. The LIST and PLOT programs do not assume that STAT.DAT is in LB0:[1,1]. Only STAT expects to find is there (or it will create one on its own). IV. QUESTIONS I will be happy to field any questions and would appreciate any favorable comments. Please bear in mind that this is the first major MACRO-11 program that I have written which may explain my lack of any subroutine calls, macros, psects, etc.