Conversation
…filing for envs that setup a non-global Ruby to be profiled)
… webapps booted via jruby-rack)
|
It looks good to me. Perhaps @headius and @danlucraft can check it out because they have more experience than me. |
|
@kares, have you thought about what could happen if the user doesn't have the JRuby version with this refactor but she uses the JRuby-rack version that supports it? I guess you should add a warning or something in the JRuby-rack side. |
|
@calavera yes I have. currently it will "work" somehow, but you definitely won't see any method names (see the sample output in jruby/jruby-rack#62). as for the jruby-rack warning - the current changes for passing arguments are generic with no emphasis on |
|
Would this also work for rack apps that aren't using jruby-rack? I'm running a basic sinatra app with JRuby. 'Arbitrary' profiling would be great for me as I'm trying to profile some code in this app but not sure how to pass in the required --profile flag. |
|
@steveodom if you're not using jruby-rack this is most probably not necessary at all and should be entirely irrelevant for your case. jruby-rack boots separate |
|
I really hate to close this request, but this request is too old and too large at this time to consider merging. The idea is intriguing, however. Do you mind retrying for the current code base? |
This is my attempt to support "arbitrary"
Rubyruntime profiling, as currently only profiling of theRuby.getGlobalRuntimeworks as expected. The primary motivation for this would be profiling web applications running on top of jruby-rack jruby/jruby-rack#62.Besides there's some "internal" profiling related refactorings, such as
JRuby::Profiler.profilereturns the fullProfileData(instead of the topInvocation). Printers are instantiated with aProfileDataargument e.g.The available profile specs are passing + there's a spec that makes sure all works for (non-global) instantiated runtimes. However, I must say I did not fully understand why the runtime needs to track the profiled methods (I thought tracking the invocations
ProfileData.addProfiledMethodas they occur would be enough but it clearly isn't). I originally thought I would also accomplish user initiated profiling working only by arequire 'jruby/profiler'andJRuby::Profiler.profile(without the need for a --profile argument).If there's anything I did wrong, did not or could have done better I would love to hear from You guys.