Feedback
Did this article resolve your question/issue?

   

Article

The Code Use Analysis -yx -> proc.mon, Explained

Information

 
TitleThe Code Use Analysis -yx -> proc.mon, Explained
URL Name21463
Article Number000136228
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: 10.x, 11.x
OS: All supported platforms
Question/Problem Description
Explanation of the Statistics With Cross-reference (-yx) Client Startup Parameter
How to get timing statistics for running ABL procedures?
How to analyze usage of procedure files
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
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.

For example:

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:
set PROCMON=C:\tmp\proc.mon

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:
  1. How many calls were made in a given period of time?
  2. How long did a procedure spend executing?
  3. 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


Where:
  • 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.
Workaround
Notes
Last Modified Date1/9/2017 12:25 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.