Monitoring

Discussion in 'Ruby' started by Vivek Vaid, Mar 31, 2011.

  1. Vivek Vaid

    Vivek Vaid Guest

    Charles - Any insights into jxinsight vs new relic?

    <snip>
    Another option would be the JXInsight tool
    (http://www.jinspired.com/products/jxinsight/), which has builtin
    support for profiling Ruby (and may make it possible to combine Ruby
    and Java results in the same output. It is, however, a commercial
    tool.
    <snip>


    On Sat, Dec 4, 2010 at 7:26 PM, Charles Oliver Nutter
    <>wrote:

    > On Fri, Nov 19, 2010 at 5:56 PM, Joel VanderWerf
    > <> wrote:
    > > I'm looking at the output from both --profile and --sample. It seems th=

    at
    > > --profile measures only jruby methods, and --sample measures only java
    > > functions. (Or maybe --sample would show some of the jruby methods if

    > they
    > > were taking enough time to be observed at a tick. My program is much mo=

    re
    > > heavily bottlenecked in the java side at the moment.)
    > >
    > > Is there any possibility of --profile instrumenting both jruby and java
    > > code?

    >
    > Currently, no. Because Ruby dispatches differently than Java,
    > including both in the same profile is at least difficult, and maybe
    > impossible. Liken it to wanting to show profile results for both Ruby
    > and C (or C++, C#, ObjC) in other implementations, when Ruby method
    > dispatch is actually implemented *in* those native languages. The two
    > worlds are largely separate.
    >
    > However...
    >
    > If you are able to force all Ruby code to compile before invocation
    > (using -X+C to force all files to compile or -Xjit.threshold=3D1 to
    > force all methods to compile on first invocation) normal Java
    > profiling tools will show the compiled Ruby method bodies alongside
    > regular Java method bodies. Be forewarned, however...as with any C or
    > C++-based implementation that JITs Ruby code to native code, the
    > resulting method are "mangled" a bit, and you'll have to do some
    > manual chewing to interpret them. But at least you can use any of the
    > dozens of Java profiling tools and show results for both Ruby and Java
    > at the same time. If there's interest, I could try to do a screencast
    > of how to do this with various JVM profilers (such as the built-in
    > -J-Xrunhprof:cpu=3Dtimes):
    >
    > =E2=9E=94 jruby -J-Xrunhprof:cpu=3Dtimes -e "def foo; a =3D 0; while a < =

    1000; a
    > +=3D 1; end; end; 100.times { foo }"
    > Dumping CPU usage by timing methods ... done.
    >
    > Result, buried in a java.hprof.txt file: https://gist.github.com/728666
    >
    > Here, the "ruby.__dash_e__.method__0$RUBY$foo" method is the jitted
    > version of the "foo" method defined above.
    >
    > Now, on JRuby 1.6, it may be possible to take this mangled output and
    > at least do a cleanup pass (because we have standardized the mangling
    > a bit better), but the profiling output is very tool-specific...so
    > de-mangling would have to happen on a per-tool basis
    >
    > Another option would be the JXInsight tool
    > (http://www.jinspired.com/products/jxinsight/), which has builtin
    > support for profiling Ruby (and may make it possible to combine Ruby
    > and Java results in the same output. It is, however, a commercial
    > tool.
    >
    > - Charlie
    >
    >
     
    Vivek Vaid, Mar 31, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wally

    Monitoring windows service

    Wally, Sep 30, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    4,853
    James D. Marshall
    Oct 3, 2004
  2. Carl Prothman [MVP]
    Replies:
    1
    Views:
    4,225
    Ali_ggl
    Mar 17, 2008
  3. KP
    Replies:
    0
    Views:
    305
  4. Elizabeth Harmon

    Monitoring a Web Page request Thread?

    Elizabeth Harmon, Nov 24, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    366
    Alvin Bruney
    Nov 30, 2003
  5. =?Utf-8?B?SmVmZiBSZWVk?=

    Failed to Start Monitoring Directory Changes

    =?Utf-8?B?SmVmZiBSZWVk?=, Feb 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,778
    =?Utf-8?B?SmVmZiBSZWVk?=
    Feb 15, 2004
Loading...

Share This Page