[jruby-user] How to tell if profiling is enabled

Ariel Valentin <[email protected]> Mon, 17 Nov 2014 21:13:56 -0500
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CAKthdGiuxxz2_-ZKQkPdwEDUBxPsHJsY9tfC=hOb2Yz6fwzfow@mail.gmail.com>
I want to profile some code but only when the built in profiler is enabled
e.g. "--profile".

At the moment I am interrogating the global runtime like so:

Java::OrgJRuby::Ruby.global_runtime.instance_config.profiling_mode !=
> Java::OrgJruby::RubyInstanceConfig::ProfilingMode::OFF


Is there a simple way to know if the profiler is enabled?

Thanks,
Ariel Valentin
e-mail: [email protected]
website: http://blog.arielvalentin.com
skype: ariel.s.valentin
twitter: arielvalentin
linkedin: http://www.linkedin.com/profile/view?id=8996534
---------------------------------------
*simplicity *communication
*feedback *courage *respect