The tools in this library are useful for monitoring machine utilization.

======================================================================

Package Performance contains a precedure called Monitor that runs and
collects data on disk space, number of users logged in, CPU utilization,
and checks to see if the garbage collector is running.  This information
is saved in a file and can be displayed at any time by running the
Report, Weekly_Report, or a user supplied report procedure.

The Monitor program can be stopped and restarted without needing to
create a new data file.  If the machine crashes, the data file will
contain all entries up to the last snapshot.

PROCEDURE MONITOR
The following call to monitor will collect data every 15 minutes and
save it in a file called performance_data.  (The context of performance
data is defined by the Context function - more on that later).  The 15
minute interval was selected as the default because that is the time
over which disk and run queue loads are calculated. 

procedure Monitor (Interval : Duration := 15 * 60.0;
                   Data_File : String := "performance_data");

PROCEDURE REPORT       

The following call to Report will display each entry in the Data_File
called performance_data between the Start_Date (1 Jan 89 at 9AM) and
End_Date (1 Jan 89 at 5PM).  Output will be directed to a file called
Daily_Report.  If the null string is used for Start_Date the program
uses 60/01/11 16:15:00 (I think that's Mikael Vester's birthday).
If the null string is used for End_Date, the current time is used.
If the null string is used for Output the report will be displayed in
Io.Current_Output.

    procedure Report (Start_Date : String := "89/1/1 9:00:00";
                      End_Date : String := "89/1/1 17:00:00";
                      Output : String := "daily_report";
                      Data_File : String := "performance_data");

The resulting report will look like this:


August 18, 1988 at 4:34:02 PM
Detailed Performance Report generated for JAZMO

      Time          DWL / RQL   Disk   DP: Cpu / Elap  Users  GC
=================  ===========  =====  ==============  =====  ==
88/08/17 00:16:12   0.02/ 0.14      0   0.087/ 0.125     1     
88/08/17 00:21:13   0.02/ 0.13      0   0.111/ 0.987     1     
88/08/17 00:26:14   0.01/ 0.11      0   0.120/ 0.128     1     

The date on the first line is the date and time the report was
generated.  JAZMO is the machine name from the Tcp_Ip_Host_Id file in
!Machine.

Time - The time the sample was taken

DWL/RQL - The first number is the average disk wait queue load over
          the last 15 minutes.
          The second number is the average number of jobs in the run
          queue over the last 15 minutes

Disk - The amount of disk space consumed over the sample period

DP: Cpu/ Elapsed - At each sample the program promotes and demotes a
                   null procedure and measures Cpu time and Elapsed
                   time for this to complete.
Users - The number of users logged in at the sample point

GC - Indicates whether the Garbage Collector is running or not.  If so
     this is indictaed by a '*'.


PROCEDURE WEEKLY_REPORT

The following call to the Weekly_Report procedure will generate a weekly
summary of the data collected in the performance_data file for the week
of 8 August 1988 and put it in the file called Weekly_Report.  The
report will only use data collected each day between the hours of
Start_Time and End_Time.  If the null string is used for Start_Time or
End_Time, then the current time of day is used.  The report generated by
this call will only include data for Monday through Friday.  If
Weekend_Too is true then Saturday and Sunday will also be included.

    procedure Weekly_Report (Week_Of : String := "88/8/15";
                             Start_Time : String := "9:00:00";
                             End_Time : String := "17:00:00";
                             Output : String := "Weekly_Report";
                             Weekend_Too : Boolean := False;
                             Data_File : String := "performance_data"); 
                             
                             
The resulting report will look like this:

August 18, 1988 at 4:40:10 PM
Weekly Machine Report generated for JAZMO
For the week starting on August 15, 1988

   Day     Disk Start  Disk End  RunQ Avg  PD Avg  Users  Samples
=========  ==========  ========  ========  ======  =====  =======
Monday           NA         NA       NA        NA   NA        0
Tuesday          NA         NA       NA        NA   NA        0
Wednesday    776182     732793     0.18     0.228    2       46
Thursday     776469     735714     0.16     0.243    3       30
Friday           NA         NA       NA        NA   NA        0

The first line shows the date and time when this report was genrated. 
JAZMO is the machine name from the Tcp_Ip_Host_Id file in !Machine.


Day - The day of the week.

Disk_Start - The total amount of disk space available on this machine at
             Start_TIme.

Disk_End - The total amount of disk space available on this machine at
           End_TIme.

RunQ Avg - The average value of the RunQ samples between Start_Time and
           End_Time

PD Avg - The average elapsed time to promote and demote the null
         procedure between Start_Time and End_Time. 

Users - The average of the sampled number of users on the machine
        between Start_Time and End_Time

Samples - The number of samples taken between Start_Time and End_Time.

======================================================================

The Start_Monitoring program can be used to start the mmonitor program
manually, and can be used as a model to modify your machine.initialize
to get the monitor program started. 

======================================================================

The context function is used by the program to find the files it needs. 
This function should return a string name for the library which will
contain the data file and the Null_Procedure.  You could create a
directory for these or use !Local for instance.

======================================================================

