how/where to set --profile.api option for jruby running inside jruby-rack/tomcat?

498 Views Asked by At

how/where to set --profile.api option for jruby running inside jruby-rack/tomcat?

This option is documented in how to profile a block of code here

2

There are 2 best solutions below

0
On

using JRUBY_OPTS won't work due how JRuby profiling is implemented - it only supported profiling a single "main" runtime ... now I was actually trying to make it work with an arbitrary runtime and my code got merged into 1.7 https://github.com/jruby/jruby/pull/96 but it still might require testing and work to be done.

for the record there's also a context paramater for setting arguments (command-line style) when using JRuby-Rack, thus if you had a JRuby version that can profile any runtime you will need to add the following code :

<context-param>
  <param-name>jruby.runtime.arguments</param-name>
  <param-value>--profile.api</param-value>
</context-param>
0
On

add to $JRUBY_OPTS

Example:

JRUBY_OPTS="--profile.api"