Inclusive Versus Exclusive Time

Exclusive time is the accumulated total time used by a method, but not including the time used by the methods that were called from it.

Inclusive time is the accumulated total time used by all invocations of the method and all methods that were called from it directly or indirectly. Inclusive times are useful if you want to see the cost of a particular task performed by the application, and you can associate this task with a single method.

However, for recursive methods, the inclusive times may not correspond well to your intuition. When a given method calls itself directly or indirectly, the time spent in the topmost invocation of the method is accumulated (for the purpose of inclusive times) for all active invocations of this method. The inclusive times depend not only on the amount of work done by the method, but also on the depth of recursion, and thus have limited value. The exclusive times for recursive methods do not exhibit this anomaly.

Most profilers collect either the inclusive time or the exclusive time, but not both. Exclusive times can be easily calculated from the inclusive times and the call graph information. However, converting the times in the opposite direction usually cannot be done with 100% certainty. When a console visualizer displays inclusive times calculated from the exclusive times, it appends “(data estimated)” to the metric title.

Time Units

Generally, all times are expressed in some abstract time unit. The actual time units in the metrics depend on the profiler agent used to generate the profile data and are beyond control of HPjmeter.

However, the actual time units are rarely needed to locate performance bottlenecks. Furthermore, even though in most cases the execution times are measured by the profiler agent in milliseconds, the profiler's intrusion can distort these times so much that the direct correspondence between the measured time and the actual application speed (when run without profiling) is lost.

CPU Versus Clock Time

The clock time is the time as measured by an external independent clock, sometimes also called wall clock. Clock time includes the time that passes for any state that a thread may be in. That is, clock time includes the time the thread spends in sleeping, waiting, performing an I/O operation, waiting for garbage collection to complete, being preempted by the operating system, and in processing.

CPU time accounts for the time spent by any of the CPUs (processors) on executing a thread. Other thread states are not counted in CPU time.

A so-called virtual CPU time, usually collected by sampling, is similar to CPU time, but includes time elapsed while the thread was ready to run, but was not actually scheduled to run by a CPU, for example, while the thread was preempted. Depending on the platform, virtual CPU time can also include the time spent in I/O operations.

If the profile data file contains the information about the profiling overhead, HPjmeter adjusts the measured CPU times by subtracting the time spent by the profiler. Thus, reported times match more closely those actually used by the Java application.

To inform you about the increased accuracy, a console visualizer will show “times in milliseconds, adjusted for profiling intrusion)” next to the metric label if the adjustment took place.

Locating Summary Information for Saved Data Sets

Summary data is displayed on the first tab that you encounter when you open a profiling data set for viewing. This information includes when the application data was collected and for how long, and a few application conditions present during the collection time.

Locating Summary Information for Saved Data Sets 69