关于 jrat 分析的问题

发布于 2024-09-27 20:58:40 字数 3434 浏览 1 评论 0原文

我正在编写一个作为服务运行的代码。基本上它监听输入并相应地产生输出。

我正在尝试使用 jrat 来分析一个包。 [我们没有 Jprofiler 的许可证,我无法设置试用版以正常工作]。

我按照这里的说明进行操作: http://transferer.blogspot.com/2009 /12/how-to-use-jrat-in-eclipse.htmlhttp://digiassn.blogspot.com/2008/01 /java-using-jrat-under-eclipse.html

我正在获取 .jrat 输出文件,但我看到的是:

001_JRat-L​​OG.jrat桌面%猫 001_JRat-L​​OG.jrat 查看器=“org.shiftone.jrat.ui.viewer.SimpleTextOutputViewBuilder” JRat:INFO(10 月 18 日 17:15:32,769)(主要) RuntimeContextImpl - 创建日志文件 JRat:INFO(10 月 18 日 17:15:32,769)(主要) RuntimeContextImpl - 运行 JRat 版本 1-alpha2 - 7 月 31 日构建 2006 JRat:信息(10 月 18 日 17:15:32,770) (主要)设置 - 字符串 'jrat.工厂'= 'org.shiftone.jrat.provider.silent.SilentMethodHandler' JRat:INFO(10 月 18 日 17:15:32,771)(主要) RootFactory - JRat 创建根 处理程序工厂...JRat:INFO(10 月 18 日) 17:15:42,451) (JRat-JMX-Poller) WaitingJmxRegistry - 注册 6 mbean(s) JRat:INFO(10 月 18 日) 17:15:42,451) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.core.jmx.info.JRatInfo@c5e9c shiftone.jrat:service=org.shiftone.jrat.core.jmx.info.JRatInfo JRat:信息(10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.util.log.LoggingManager@11756a4 shiftone.jrat:service=org.shiftone.jrat.util.log.LoggingManager JRat:信息(10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.core.jmx.benchmark.Benchmark@b301f2 shiftone.jrat:service=org.shiftone.jrat.core.jmx.benchmark.Benchmark JRat:信息(10 月 18 日 17:15:42,453) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean Transformer[AsmInjectorStrategy(使用 http://asm.objectweb.org)] shiftone.jrat:service=org.shiftone.jrat.inject.bytecode.Transformer JRat:信息(10 月 18 日 17:15:42,454) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean org.shiftone.jrat.core.shutdown.ShutdownRegistry@4be2cc shiftone.jrat:service=org.shiftone.jrat.core.shutdown.ShutdownRegistry JRat:信息(10 月 18 日 17:15:42,454) (JRat-JMX-Poller) ServerJmxRegistry - 注册MBean FileOutputRegistry[PrintWriter[001_JRat-L​​OG.jrat]] shiftone.jrat:service=org.shiftone.jrat.core.output.FileOutputRegistry JRat:信息(10 月 18 日 17:15:48,825) (JRat-Shutdown)ShutdownRegistry - 关闭 向下...[Transformer[AsmInjectorStrategy(使用 http://asm.objectweb.org)], FileOutputRegistry[PrintWriter[001_JRat-L​​OG.jrat]]] JRat:信息(10 月 18 日 17:15:48,826) (JRat-Shutdown)ShutdownRegistry - 关闭 FileOutputRegistry[PrintWriter[001_JRat-L​​OG.jrat]]... JRat:信息(10 月 18 日 17:15:48,826) (JRat-关闭)FileOutputRegistry - 关闭文件输出 [PrintWriter[001_JRat-L​​OG.jrat]] JRat:信息(10 月 18 日 17:15:48,826) (JRat-关闭)FileOutputRegistry - 结束: PrintWriter[001_JRat-L​​OG.jrat] JRat:信息(10 月 18 日 17:15:48,826) (JRat-关闭)FileOutputPrintWriter - 关闭 JRat:INFO (10 月 18 日 17:15:48,826) (JRat-Shutdown) FileOutputRegistry - 删除 PrintWriter[001_JRat-L​​OG.jrat]

以前有人在 Linux 上使用过它吗?我在想,因为我将其作为服务运行..运行我的应用程序后,我点击终止按钮来停止我的应用程序[与其他应用程序相反,这些应用程序可能在工作完成后自行终止]..这可能不会使应用程序正常退出因此 jrat 不会产生转储?但这只是一个盲目的猜测。

谢谢

附注: 我正在使用日食 Java 版本 1.6.0_13

编辑: 无法使其正常工作,但尝试了 Visualvm,效果还不错。 然而,需要分析远程应用程序,[因为我想分析我的服务的一部分,并通过简单的方法来强调这部分代码并获取其编号来自服务器本身],所以将寻找易于远程使用的东西。

I am working on a code which runs as a service. Basically it listens for input and produce output accordingly.

I am trying to profile a package using jrat. [We do not have a licence for Jprofiler and I couldnt set up the trial version to work properly].

I followed the instructions here:
http://transferer.blogspot.com/2009/12/how-to-use-jrat-in-eclipse.html
and
http://digiassn.blogspot.com/2008/01/java-using-jrat-under-eclipse.html

I am getting the .jrat output files but all I see is this:

001_JRat-LOG.jrat desktop% cat
001_JRat-LOG.jrat
viewer="org.shiftone.jrat.ui.viewer.SimpleTextOutputViewBuilder"
JRat:INFO (Oct/18 17:15:32,769) (main)
RuntimeContextImpl - logfile created
JRat:INFO (Oct/18 17:15:32,769) (main)
RuntimeContextImpl - Running JRat
version 1-alpha2 - built on July 31
2006 JRat:INFO (Oct/18 17:15:32,770)
(main) Settings - string
'jrat.factory' =
'org.shiftone.jrat.provider.silent.SilentMethodHandler'
JRat:INFO (Oct/18 17:15:32,771) (main)
RootFactory - JRat creating root
handler factory... JRat:INFO (Oct/18
17:15:42,451) (JRat-JMX-Poller)
WaitingJmxRegistry - registering 6
mbean(s) JRat:INFO (Oct/18
17:15:42,451) (JRat-JMX-Poller)
ServerJmxRegistry - registerMBean
org.shiftone.jrat.core.jmx.info.JRatInfo@c5e9c
shiftone.jrat:service=org.shiftone.jrat.core.jmx.info.JRatInfo
JRat:INFO (Oct/18 17:15:42,453)
(JRat-JMX-Poller) ServerJmxRegistry -
registerMBean
org.shiftone.jrat.util.log.LoggingManager@11756a4
shiftone.jrat:service=org.shiftone.jrat.util.log.LoggingManager
JRat:INFO (Oct/18 17:15:42,453)
(JRat-JMX-Poller) ServerJmxRegistry -
registerMBean
org.shiftone.jrat.core.jmx.benchmark.Benchmark@b301f2
shiftone.jrat:service=org.shiftone.jrat.core.jmx.benchmark.Benchmark
JRat:INFO (Oct/18 17:15:42,453)
(JRat-JMX-Poller) ServerJmxRegistry -
registerMBean
Transformer[AsmInjectorStrategy(uses
http://asm.objectweb.org)]
shiftone.jrat:service=org.shiftone.jrat.inject.bytecode.Transformer
JRat:INFO (Oct/18 17:15:42,454)
(JRat-JMX-Poller) ServerJmxRegistry -
registerMBean
org.shiftone.jrat.core.shutdown.ShutdownRegistry@4be2cc
shiftone.jrat:service=org.shiftone.jrat.core.shutdown.ShutdownRegistry
JRat:INFO (Oct/18 17:15:42,454)
(JRat-JMX-Poller) ServerJmxRegistry -
registerMBean
FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]]
shiftone.jrat:service=org.shiftone.jrat.core.output.FileOutputRegistry
JRat:INFO (Oct/18 17:15:48,825)
(JRat-Shutdown) ShutdownRegistry -
shutting
down...[Transformer[AsmInjectorStrategy(uses
http://asm.objectweb.org)],
FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]]]
JRat:INFO (Oct/18 17:15:48,826)
(JRat-Shutdown) ShutdownRegistry -
shutting down
FileOutputRegistry[PrintWriter[001_JRat-LOG.jrat]]...
JRat:INFO (Oct/18 17:15:48,826)
(JRat-Shutdown) FileOutputRegistry -
closeFileOutputs
[PrintWriter[001_JRat-LOG.jrat]]
JRat:INFO (Oct/18 17:15:48,826)
(JRat-Shutdown) FileOutputRegistry -
closing :
PrintWriter[001_JRat-LOG.jrat]
JRat:INFO (Oct/18 17:15:48,826)
(JRat-Shutdown) FileOutputPrintWriter
- closing JRat:INFO (Oct/18 17:15:48,826) (JRat-Shutdown)
FileOutputRegistry - remove
PrintWriter[001_JRat-LOG.jrat]

Has someone used it before on linux ?. I am thinking since I am running this as a service .. after running my application I hit terminate button to stop my application [opposed to other applications which might terminate themselves after the work is done] .. this probably doesnt make the application exit gracefully and hence jrat does not produce a dump ?? This is just a blind guess though.

Thanks

P.S:
I am using eclipse
Java version 1.6.0_13

Edits:
Couldnt get this working , but tried Visualvm instead which works okay.
However need to profile a remote appliaction,[Since I want to profile a part of my service and easy way to stress that part of the code and gets its number is from the server itself] so will look for something that is easy to use remotely.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光清浅 2024-10-04 20:58:40

您可以尝试 BTrace,它作为代理安装在您正在使用的应用程序上。 BTrace 可以与远程可视化工具结合使用,以实现所收集数据的实时和历史图表。

请参阅以下问题了解更多信息:Java 方法的高执行时间

You could try BTrace, which installs as an agent on the application you are using. BTrace can be coupled with a remote visualizer to enable real time as well as historical charting of collected data.

Please refer to the following question for more info: High Execution time on java methods

宫墨修音 2024-10-04 20:58:40

jrat 在过去几年中并不是很活跃。

也许最好的开源方法是使用 AspectJ 的 JVMTI 代理,如以下文章中所述:http://andrewclement.blogspot.com.br/2009/02/load-time-weaving-basics.html

您可以编写在类加载时应用于类的方面JVM。

jrat hasn't been very active in the last years.

Maybe the best open-source approach is using AspectJ's JVMTI agent as explained in the following post: http://andrewclement.blogspot.com.br/2009/02/load-time-weaving-basics.html

You can write aspects that will be applied to classes as they are loaded by the JVM.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文