With Play 2.4, you can enable YourKit for production distributions on Unix/Linux systems (not running within SBT) with the SBT plugin sbt-yourkit. This will add the appropriate YourKit agent shared object, and startup flags, to allow the agent to be used by Play in production.
The agent is added to the archive generated by sbt dist
, or other build targets described here.
The steps to add the plugin are:
Add the plugin to your SBT build, e.g. add the following to project/plugins.sbt
:
addSbtPlugin("com.gilt.sbt" % "sbt-yourkit" % "0.0.2")
Add the YourKit
AutoPlugin to your project definition, e.g. add the following to build.sbt
:
enablePlugins(YourKit)
Further information is available at the plugin link above.
Note: This does not enable YourKit debugging in Play's development mode. If you want to test your program with YourKit locally, possibly the easiest way of doing this is to use the universal:stage
target to create a directory containing your application - this will usually create a directory under <PROJECT_DIRECTORY>/target/universal/stage
, and you can run your application (including YourKit integration) from the script in the bin/
directory.