14.7. Profiling

The Kodo profiling capability allows for profiling of application code. It is designed to help optimize the use of Kodo, and is not intended to be a generic profiling tool. Only Kodo specific APIs are instrumented.

The profiling capability can either be used standalone using the Kodo Profiling Console, or inside the Kodo Management Console using the Profiling MBean. To use the profiling capability remotely see Section 12.4.8, “Profiling MBean”.

The profiling capability can be used standalone locally. To bring up the Kodo Profiling Console, set the following properties (see Section 2.6.32, “kodo.ProfilingAgent” and Section 2.6.34, “kodo.ProfilingInterface”):

The left pane of the Profiling Console contains a tree. Each node in the tree represents a call in a call stack. The root of each call stack is a PersistenceManager. Note that you must use the default PersistenceManager (or an extension of it) in order to see profiling information. Each node may be composed of three items - the node name, the amount of time spent in each node, and the percentage of the total time spent in the parent node that this child node contributes. Details about a node can be seen in the right panes by selecting a node. The top right pane(s) yeild detailed information about the node (e.g. the location in code where a transaction was started, or the SQL generated for a query), and the bottom right pane contains statistics about the node.

The Profiling Console has a Profiling Toolbar. It has the following controls:

The profiling call tree has a context menu that is brought up in an operating system dependent manner (e.g. right click on Windows). The following options are available:

The detail information for a PersistenceManager contains information about objects that were fetched in the context of that PersistenceManager. The detail area consists of information about where in code the PersistenceManager was created, and a TreeTable with information on each field in each Persistence Capable class. The TreeTable has the following columns:

The profiling capability can be used to create profiling exports. Exported profiling data is stored in files ending with the .prx suffix. To view exported profiling data, use the profilingviewer command, e.g. profilingviewer myexport.prx. To enable automatic export of profiling data, set the following properties (see Section 2.6.32, “kodo.ProfilingAgent” and Section 2.6.34, “kodo.ProfilingInterface”):

The export value takes the following optional parameters:

For example, in order to export data every five minutes with a basename of MyExport include in your properties the following line:

The description of PersistenceManager and transaction nodes can be controlled by the kodo.ProfilingHelper property (see Section 2.6.33, “kodo.ProfilingHelper”). Standard options for this property are:

The stack value takes the following optional parameters: