The Basher YourKit Integration is a library which, when plugged in together with the Basher runtime, allows for automatic control of YourKit CPU profiling as part of a Basher run.

By combining Basher's ability to exercise an application in a threaded fashion with YourKit's profiling agent, it is now possible to create CPU profiling snapshots as part of your Maven builds. The build can run over night and the profiling snapshot is available in the morning, ready for analysis.

YourKit profiling is started at the beginning of the RUN phase, whenever collection is started. A snapshot is captured at the end, whenever collection is stopped.

Controlling Profiling

To enable automatic profiling control in Basher, the following needs to be installed and/or configured:

  1. Download and install YourKit (goto)
  2. Make sure your library path (or path if running on Windows) points to the location of your YourKit installation
    bash$ export LD_LIBRARY_PATH=$YOURKIT_HOME/bin/<your-platform>
  3. Edit your settings.xml (most commonly located in $HOME/.m2/settings.xml) and add a property called This should point to the installation directory of YourKit.
          <>Path to YourKit home</>
  4. Add a dependency to the Basher YourKit jar to your project
  5. Configure YourKit profiling for the Maven Basher plugin configuration
            <basherContext implementation="net.sourceforge.basher.BasherContext">
              <profilerContext implementation="net.sourceforge.basher.YourKitProfilerContext"/>
  6. Run the Maven Basher plugin. If successful, you should see the YourKit controller initializing as shown in the log snippet below.
    [INFO] Initiating forking run
    2010-05-06 10:08:58,219 INFO YourKitController [initializeService] Initializing YourKit Controller
    2010-05-06 10:08:58,225 INFO YourKitController [initializeService] Hostname: localhost
    2010-05-06 10:08:58,226 INFO YourKitController [initializeService] Port: 10020
    2010-05-06 10:08:58,231 INFO YourKitController [connect] Connecting to profiling agent
    2010-05-06 10:08:58,297 INFO YourKitController [connect] Successfully connected to profiling agent