Consultor Eletrônico



Kbase 21463: The Code Use Analysis -yx -> proc.mon, Explained
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   26/09/2006
Status: Verified

GOAL:

How to analyze usage of procedure files

GOAL:

Explanation of the -yx Startup Parameter

GOAL:

How to get timing statistics for running 4GL procedures?

FACT(s) (Environment):

Progress 9.x

FIX:

The Code: Use Analysis -yx -> proc.mon.

This Client Startup parameter will tell you where your busiest code is.

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 OS UNIX OS
INTERNAL Procedure RUN Cost 1 1
EXTERNAL Procedure RUN Cost 5 2
This parameter will also help you to watch for:

-- large numbers of calls; put these in internal procedures or (better) include files.
-- Rereads; could use more -mmax client memory.
-- Long execution times; concentrate rewrite efforts here.

You can try to collect associated code into procedure libraries. This way is faster to run, no fopen() step. This means that the libraries containing all the procedures needed for the session are already loaded in memory. Use -pls if net-shared / found on fileserver V9 host-based? Use Shmem libraries. This will result in an improvement of execution and a gain in memory for the parameters -B, -Bt, -mmax.

Use Statistics with Cross-reference (-yx) to collect procedure call statistics and write them to an output file. With this parameter, you can monitor information 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)?

Progress places the default output file for the -yx parameter, proc.mon, in your current working directory. However, you can specify a different output file by using the PROCMON environment variable. Simply set PROCMON to point to the file you want to use.

For example, in a UNIX environment, if you want 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
On a windows system you need to create a system variable PROCMON and give the value as for example: C:\tmp\proc.mon. Use the SHOW-STATS statement to write the procedure call statistics to the output file. The CLEAR option sets all counters and timers (such as Calls and Time) to 0. When you exit Progress, the -yx parameter writes the procedure call statistics to the output file whether or not you use SHOW-STATS.

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-deltrig 1635 133 1635 0 161
backlog fprename 1363 4 0 0 142
backlog f-str2itm 138.96 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

The fields that appear in the output file proc.mon are as follows:

Caller

The names of any calling procedures. The word <top> indicates that there was no calling procedure, and that you ran the called procedure directly from the Progress Procedure Editor.

Callee

The names of the called procedures.

Load Size

The size, in bytes, of each called procedure as Progress loads it into memory. If you see a load size of 0, the called procedure is an uncompiled source procedure (.p file), or an r-code file (.r file) that was previously loaded into memory.

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..