home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
SYSACT11.ZIP
/
SYSACT.DOC
next >
Wrap
Text File
|
1988-03-27
|
4KB
|
118 lines
System Activity V1.10
Written by Andy Brunner
27-Mar-88
Description:
------------
This OS/2 protected mode program allows the user to inspect some of the
key system activities. It includes the display of:
- Total CPU usage (in percent)
- Largest free physical memory block (RAM)
- Swap file increase (in KB)
- Number of spool files
- Total size of all spool files (in KB)
Command Syntax:
---------------
[drive][path]SYSACT swappath|NULL spoolpath|NULL
The 'swappath' specifies the directory, where the system swap file
'SWAPPER.DAT' resides. This must be the same as the CONFIG.SYS
statement 'SWAPPATH='.
The 'spoolpath' specifies the directory, where the spool files resides.
If you have set up the CONFIG.SYS 'RUN=' statement as e.g:
RUN=C:\OS2\SPOOL.EXE C:\OS2\SPOOL /D:LPT1 /O:LPT1
to automatically start the system spooler using the C:\OS2\SPOOL directory,
then you will need to use 'C:\OS2\SPOOL' as the directory in the commmand
argument to SYSACT.
Both parameters may be suppressed with the keyword 'NULL', in case you
do not have the swap and/or spool active.
Example:
--------
SYSACT C:\OS2\SWAP C:\OS2\SPOOL
will start the monitoring of the system with the swap file in the directory
C:\OS2\SWAP and the spool files in C:\OS2\SPOOL.
Other valid examples:
---------------------
- SYSACT C:\ C:\ Swap and spool in root directory
- SYSACT NULL C:\SPOOL No swap active and spool in C:\SPOOL
- SYSACT C:\OS2\SWAP NULL Swap in C:\OS2\SWAP and no spooler active
- SYSACT NULL NULL No swap and no spooler active
Some background information:
----------------------------
How do I collect those figures ? Since this was the No.1 question from
the Version 1.00 users, I will try to give you some background information
on this.
CPU Activity:
-------------
Two very small threads are started at the beginning. One is at the highest
possible priority (Critical class +31). The other is at the lowest possible
priority (Idle class -31). This low priority class thread simply clears a
RAM semaphore (owned by the high priority class thread) and waits 32ms. This
loop is executed forever. The high-priority class thread waits for the RAM
semaphore to be cleared or a one-second time-out. Now, the only thing I have
to calculate is the number of RAM semaphore clear's it received during one
second. This results in the CPU activity (in percent). This mechanism works,
because the system dispatches always from top-to-bottom (Critical class,
Normal or regular class, Idle class). If the low priority class thread is
dispatched, then there is no other work to be done (during this times-slice).
The CPU activity is updated on screen every second.
Free RAM:
---------
This is simply the visual number resulted from the API call DOSMEMAVAIL. This
figure is updated on screen every 250ms.
Swap and spool file statistics:
-------------------------------
These are simply the visual numbers resulted from a directory scan of
the swap file [path]\SWAPPER.DAT and the directory scan of the spool
files [path]\SPL*.SL1. Those figures are updated on screen every 250ms.
How to stop SYSACT.EXE:
-----------------------
Simply press CTRL-BREAK. This will dispatch a signal routine, which does
the neccessary cleanup.
Futures:
--------
I would be very glad to add other useful system information, if possible.
Since I do not yet see any standard way to collect process or thread
related information, I am waiting for hints or tips from you.
Please let me know if you have any comments, suggestions or enhancements.
Hope you enjoy it !
Andy Brunner (BIX 'abrunner')
27-Mar-88