Fully featured low overhead profiler for Java EE and Java SE platforms.
Monitoring and profiling solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

CPU sampling settings

CPU sampling settings allow to customize some aspects of CPU sampling.

CPU tracing settings are specified separately, as described here.

When the settings are applied

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

Configuring the settings

To configure CPU sampling settings use Settings | CPU Sampling... in the main menu.

The settings are also accessible via a link in the CPU profiling toolbar popup:

The following dialog appears:

Configurable properties:

  • Time measurement

    Specify whether CPU or wall time will be measured for profiled methods.

    There can be any number of lines in the this format:

    walltime=<fully qualified class name> : <method name> ( <comma-separated parameter types> )
    or
    walltime=<fully qualified class name>

    Matching methods will be measured with wall time, all other methods - with CPU time.

    If there are no lines with walltime specified, all methods will be measured with CPU time.

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

    walltime=Foo.Bar : print*(*)

    The default configuration for CPU sampling is to measure wall time for I/O methods and CPU time for all other methods.

    "Use Preconfigured Settings..." allows you to choose one of recommended presets.

  • Sampling period

    Specify how often samples are taken with sampling_period_ms=<time in milliseconds>. By default samples are taken each 20 milliseconds (sampling_period_ms=20).

Configuration file

The settings are stored in the file

<user home>/.ynp/sampling.txt

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

This file is automatically updated in your user home directory when you apply changes in the UI (see above).

You can edit this file manually, but note that it may be fully overwritten with "Use Predefined Settings..." in UI.

The settings file is read and applied when CPU sampling is started with:

  • API method Controller.startCPUSampling(null)
  • trigger action StartCPUSampling

You can specify a custom settings file for a particular application by using the startup option sampling_settings_path