Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to monitor the execution of JRuby scripts

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report