Help / Release / J 4.05 / Performance Monitor Utilities

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



Performance Monitor Utilities

initial writing: 2000-07-17
last updated: 2001-04-13


PM is an extension to the facilities provided by the Performance Monitor foreign conjunctions (6!:8 and 6!:13), which are described in the J dictionary.

PM provides functions to turn the Performance Monitor on and off, and analyze and display the results. For the most part, you need only turn the Performance Monitor on, run your application, then display the results.

To load, enter:

   load 'jpm'

This populates the jpm locale. PM ignores any definitions in this locale, so PM definitions should be run directly from this locale, rather than from cover functions in the z or other locales.

The following are the main definitions:

 start_jpm_ set PM on
stop_jpm_ set PM off
read_jpm_ read PM data
showtotal_jpm_ show totals
showdetail_jpm_  show details
viewtotal_jpm_ view totals
viewdetail_jpm_ view details


The definitions stop_jpm_ and read_jpm_ are usually not required. If PM is on, any call to read_jpm_ will call stop_jpm_ , while if the PM data has not already been read, any call to the show or view verbs will call read_jpm_ first.

Examples

First load jpm :

   load 'jpm'

Example 1

   start_jpm_ ''
   runapp ''
   showtotal_jpm_''
   showdetail_jpm_ 'runapp'
   showdetail_jpm_ 'printapp'

Example 2

The following runs PM for app1 and app3, but not app2:

   start_jpm_ ''
   app1 ''
   stop_jpm_ ''
   app2 ''
   start_jpm_ ''
   app3 ''
   showtotal_jpm_ ''

Example 3

   start_jpm_ ''
   runapp ''
   viewtotal_jpm_ ''

This displays the PM results in a grid. Detail results for any definition are shown by double-clicking the line in the grid.

Definitions

opt start_jpm_ size    opt = left argument to 6!:10 ,

(default 1=all lines, 0=wrap)
size = data area, or size of data area (if '' uses SIZE_jpm_)

Starts PM, with given options and buffer size. If PM is already on, the call is ignored.

 
stop_jpm_ Stops PM. If PM is already off, the call is ignored.
 
read_jpm_ Read the PM data. If PM is on, stops PM. If PM data has

already been read, the call is ignored.

 
opt showtotal_jpm_ names opt has 0 - 3 numbers:

0 - 0=time (default) 1=space
1 - 0=distinguish names by locales (default) 1=total names
2 - percentage of values show in detail (default 90)

Show the PM total data. If PM data has not yet been read, calls read_jpm_ first.

 
opt showdetail_jpm_ name opt is 0=time (default) 1=space

name is a single name, given as: name_locale_ or name;locale

Show the PM detail data for the given name. If PM data has not yet been read, calls read_jpm_ first.

 
opt viewtotal_jpm_ names View the PM total data in a grid. Arguments are the same as

for showtotal_jpm_ .

 
opt viewdetail_jpm_ name View the PM total data in a grid. Arguments are the same as

for showdetail_jpm_ .




>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release