The Code: Use Analysis -yx -> proc.mon.
The RUN Statement is expensive in terms of time; it may vary between Operating Systems. The average cost for a RUN of an internal or external procedure, assuming that the procedures are deployed locally is:Procedure Run WINDOWS UNIX
INTERNAL Procedure RUN Cost 1 1
EXTERNAL Procedure RUN Cost 5 2
The -yx Client Startup parameter will help to identify where the busiest code is by collecting procedure call statistics. It will specifically help to identify application code with:
- A large numbers of calls; which could be moved to internal procedures or include files.
- Rereads; which will used more -mmax client memory than needed
- Long execution times; where rewrite efforts should be focused initially
Associated code can be placed into procedure libraries. This means that the libraries containing all the procedures needed for the session are already loaded in memory. This way is faster to run, no fopen() step which will result in an improvement of execution times and a gain in memory for the parameters -B, -Bt, -mmax.
Progress places the default output file for the -yx parameter, proc.mon
, in the current working directory . It can be placed in a different output file destination by setting the PROCMON environment variable.
UNIX:, to use a file named stats in the /usr/tmp directory, enter the following command on the command line:
PROCMON=/usr/tmp/stats; export PROCMON
WINDOWS: Create a System Environment Variable PROCMON and provide the directory and filename in the value. example: C:\tmp\proc.mon
Or in the current session window:
For AppServer sessions, the PROCMON will point to the same file for all AppServer Agents. To create a proc.mon output file for each AppServer Agent:
- Create a script that sets the PROCMON variable and calls the _proapsv executable.
- In the ubroker.properties file set the srvrExecFile to the script instead of _proapsv
Ensure that there are sufficient write permissions to where proc.mon will be created, otherwise while running with xref statistics will fail:
Cannot open procedure cross-reference monitor file. (1985)
Statistics with Cross-reference (-yx) will collect procedure call statistics and write them to an output file. With this parameter, metrics can be gathered to answer the questions:
- How many calls were made in a given period of time?
- How long did a procedure spend executing?
- How often was a procedure swapped to and from the temporary file SRT file)?
When the client session ends, the -yx parameter writes the procedure call statistics to the output file whether or not you use SHOW-STATS when the session ends. With SHOW-STATS, the AVM can be forced to write the statistics at a specific time, instead of at session end. The SHOW-STATS CLEAR option resets all counters and timers (such as Calls and Time) to 0. Output of proc.mon example:Caller Callee Load Size Calls Rd Bytes Reread Time
<top> start1 929 1 929 0 1
start1 start2 17847 1 17847 0 9
start2 nightly 75071 1 75071 0 13001
backlog cd-dtrig 1635 133 1635 0 161
backlog fprename 1363 4 0 0 142
backlog f-str2itm 13896 635 13896 0 57001
backlog notes 3343 7 3343 0 35
nightly rbase-load 38908 1 38908 0 2763721
rbase fprename 1363 3 0 0 687
rbase notes 3343 55820 0 0 155590
nightly xref-dmp 2447 1 2447 0 398
nightly ntlyrpts 49078 1 49078 0 372
- Caller - Lists the names of any Calling Procedures. The word <top> indicates that there was no calling procedure, and the called procedure was run directly from the Progress Procedure Editor.
- Callee - Lists the names of the Called Procedures.
- Load Size - Lists the Size of each Called Procedure in bytes as it is loaded it into memory. A load size of 0 indicates that the Called Procedure is an un-compiled source procedure (.p file), or an r-code file (.r file) that was loaded into memory previously.
- Calls - The number of times the Caller procedure calls the Callee procedure.
- Rd Bytes - Generally, the Called Procedure's load size. However, if the procedure is swapped out of memory and later restored, Rd Bytes equals the procedure's Load Size added to the number of bytes read from the SRT file. Rd Bytes grows larger each time the procedure is swapped out of memory and restored from the SRT file.
- Reread - The number of bytes Progress reads from the SRT file to restore a Caller Procedure that was overwritten. Progress restores only what is necessary to continue executing the Caller procedure. In some cases, this is less than the amount swapped to the SRT file.
- Time - The total execution time of the Called Procedure, in milliseconds.