Process::getMethodProfileInfo Method

getMethodProfileInfo(jdo:       JadeDynamicObject input;
                     truncated: Boolean output);

The Process class getMethodProfileInfo method retrieves method profiling information for the process specified as the method receiver.

The retrieved information is presented as a set of dynamic objects in the children collection of the dynamic object instance specified by the jdo parameter; that is, the information is contained in the collection jdo.children.

The calling process is responsible for creating and deleting the JadeDynamicObject passed to the method. It is also responsible for deleting the JadeDynamicObject instances inserted into the jdo.children collection (for example, by purging the collection).

If the JadeDynamicObject instance used as the jdo parameter is persistent, the JadeDynamicObject instances added to the children collection are also persistent. Similarly, if the object is transient, the child dynamic objects are transient.

The properties of the JadeDynamicObject instances in the children collection are listed in the following table.

Property Type Description
method Object Reference to the Method instance for the profiled method
calls Integer64 Number of times the method was called
totalCpuTime Integer64 Total CPU time in microseconds consumed by the method and the methods it called
cpuTimeInMethod Integer64 Total CPU time in microseconds consumed by the method only; that is, excluding time consumed by the methods it called
totalClockTime Integer64 Total clock time in microseconds elapsed while executing the method and the methods it called
clockTimeInMethod Integer64 Total clock time in microseconds elapsed while executing the method only; that is, excluding time elapsed while executing the methods it called

Time spent in recursive method calls is correctly accounted for as time spent executing the method.

The truncated parameter indicates if the amount of method profile information to be retrieved exceeded an internal buffer limit so was truncated. If the truncated parameter is returned as false, all method profiling information is present in the JadeDynamicObject instance specified in the jdo parameter. If it is returned as true, some entries have been truncated. When truncation occurs, entries with the lowest "total calls" values are omitted.

Truncation occurs when the amount of profiling information to be returned exceeds 1,000 entries.

Truncation occurs only when method profiling information is retrieved for processes running on remote nodes.

The CPU time has a granularity of 10 or 15 milliseconds, which means that the CPU time figures for methods of short duration are subject to inaccuracy due to the large granularity. However, the clock times have a much smaller granularity and are therefore more accurate.

Clock times may fluctuate depending on other activity on the same machine. The total clock times include time spent waiting; for example, to wait for a Window event, to lock an object, or for a user response to a modal form.

The children collection of the jdo parameter passed to the getMethodProfileInfo method is purged each time the method is called.

When displaying method profiling results, you can use the qualifiedName method of the corresponding Method instance (specified in the method parameter) to obtain the name of a profiled method, and the Object class isKindOf method to determine if the method is an external method or a JADE method.

Any process can call the getMethodProfileInfo method to retrieve method profiling information, if it is available. However, any process can also call the removeMethodProfileInfo method to remove profiling information.

If you call the getMethodProfileInfo method on a target process that has terminated, an exception of type 4 (Object not found) is raised.

For usage and output examples of this method, see the Process class getMethodProfileInfo method in Volume 2 of the JADE Encyclopaedia of Classes.