DocumentationJava Profiler 7.0 HelpTime measurement (CPU time, wall time)
previous      content      next
Time measurement (CPU time, wall time)

This is an advanced topic. It provides additional details that you do not normally have to know to profile your applications.

There are two ways to measure time:

  • CPU time - the time actually spent by CPU executing method code
  • Wall time - the real-world time elapsed between method entry and method exit. If there are other threads/processes concurrently running on the system, they can affect the results.

CPU sampling/tracing

CPU sampling and tracing measure:

  • Wall time: For methods that rarely consume a lot of CPU directly; instead they perform network calls, involve OS background activity or delegate to other applications such as database engines. They include:
    • By default, basic file and socket I/O operations. See section 'Customization' below to learn how to change this.
    • J2EE queries
  • CPU time: for all other methods

Customization

To customize for which methods the wall time is measured, create or edit the following configuration file:

<user home>/.yjp/config/.walltime

where user home corresponds to the account under which a profiled application is launched.

This is a text file. Its lines should be in this format:

<fully qualified class name> <method name> <method signature>

Wildcards ('*') are accepted. E.g. the following specifies all methods of class com.Foo.Bar, which names start with 'print':

com.Foo.Bar print* *

By default, the configuration file doesn't exit, so you have to create it to customize the settings. If the configuration file doesn't exist, it is assumed to have the following content:

java.io.RandomAccessFile    readBytes    ([BII)I
java.io.RandomAccessFile    read         ()I
java.io.RandomAccessFile    write        (I)V
java.io.RandomAccessFile    writeBytes   ([BII)V
java.net.SocketInputStream  socketRead0  (Ljava/io/FileDescriptor;[BIII)I
java.net.SocketOutputStream socketWrite0 (Ljava/io/FileDescriptor;[BII)V
 

The settings are read each time you start CPU tracing or sampling. This means you can change the settings without restarting the profiled application.

To measure CPU time for all methods, the settings file should be empty.

Monitor profiling

Monitor profiling measures wall time for all waits and blockings.

previous      content      next