Get the App
SLTechnology News&Howtos  ›  Development  › 

How to monitor the execution of JRuby scripts

Shulou Source: shulou.com Published: 2022-06-02 19:18:31 12月01日 Update

Editor to share with you how to monitor the implementation of JRuby scripts, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Jruby essentially starts a jvm, then reads the Ruby script and interprets it (it can also be compiled), so of course jprofiler can also monitor the execution of the jruby script.

Execution of JRuby script

Jruby hello.rb is equivalent to executing:

Java-Xmx378m-Xss1024k-Djruby.home=/usr/local/jruby

-Djruby.lib=/usr/local/jruby/lib Djruby.script=jruby org.jruby.Main hello.rb, which you can see through ps aux | grep jruby. Therefore, to monitor JRuby, it is easy to configure jprofiler. Add these parameters to VM arguments (which can include parameters of jruby). For example, my VM arguments configuration is as follows:

-server-Xmx378m-Xss1024k-Djruby.script=jruby-Djruby.thread.pooling=true

-Djruby.jit.threshold=0-Djruby.compile.fastest=true

-Djruby.home=D:jrubyjruby-1.1RC2-Djruby.lib=D:jrubyjruby-1.1RC2lib

Main class or executable JAR, fill in: org.jruby.Main. Then fill in your script location in the Arguments column:

D:rubylibhello.rb

*, don't forget to add bsf.jar and jruby.jar under the jruby/lib directory to Class Path.

The above is all the contents of the article "how to monitor the execution of JRuby scripts". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Scripts monitoring articles content parameters configuration of course not much location can pass most that is more essence directory knowledge equivalence industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux Apple Microsoft vpn