2010-10-19 50 views
1

我正在研究作爲服務運行的代碼。基本上它會相應地監聽輸入併產生輸出。關於jrat分析的問題

我試圖用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 viewer =「org.shiftone.jrat.ui.viewer.SimpleTextOutputViewBuilder」 JRat:INFO(Oct/18 17:15:32,769)(main) RuntimeContextImpl - 創建日誌文件 JRat:INFO(Oct/18 17:15:32,769)(main) RuntimeContextImpl - 運行JRat 版本1-alpha2 - 建立於7月31日 2006 JRat:INFO(Oct/18 17:15:32,770) )設置 - 串 'jrat.factory'= 'org.shiftone.jrat.provider.silent.SilentMethodHandler' JRAT:INFO(十月/ 18 17:15:32771)(主要) RootFactory - JRAT創建根 處理程序工廠... JRat:INFO(Oct/18 17:15:42,451)(JRat-JMX-Poller) WaitingJmxRegistry - 註冊6 mbean JRat:INFO(Oct/18 17:15:42,451)( JRat-JMX-Poller) ServerJmxRegistry - registerMBean [email protected] shiftone.jrat:service = org.shiftone.jrat.core.jmx.info.JRatInfo JRat:INFO(Oct/18 17:15:42,453) (JRAT-JMX-輪詢)ServerJmxRegistry - registerMBean [email protected] shiftone.jrat:服務= org.shiftone.jrat.util.log.LoggingManager JRAT:INFO(十月/ 18 17:15:42453) (JRAT-JMX-輪詢)ServerJmxRegistry - registerMBean [email protected] shiftone.jrat:服務= org.shiftone.jrat.core .jmx.benchmark.Benchmark JRat:INFO(Oct/18 17:15:42,453) (JRat-JMX-Poller)ServerJmx註冊表 - registerMBean 變壓器[AsmInjectorStrategy(使用 http://asm.objectweb.org)] shiftone.jrat:服務= org.shiftone.jrat.inject.bytecode.Transformer JRAT:INFO(十月/ 18 17: 15:42454) (JRAT-JMX-輪詢)ServerJmxRegistry - registerMBean [email protected] shiftone.jrat:服務= org.shiftone.jrat.core.shutdown.ShutdownRegistry JRAT :INFO(十月/ 18 17:15:42454) (JRAT-JMX-輪詢)ServerJmxRegistry - registerMBean FileOutputRegistry [PrintWriter的[001_JRat-L​​OG.jrat] shiftone.jrat:服務= org.shiftone.jrat.core .outp ut.FileOutputRegistry JRAT:INFO(十月/ 18 17:15:48825) (JRAT關閉)ShutdownRegistry - 關閉 下來... [變壓器[AsmInjectorStrategy(使用 http://asm.objectweb.org)] , FileOutputRegistry [PrintWriter [001_JRat-L​​OG。JRAT]]] JRAT:INFO(十月/ 18 17:15:48826) (JRAT關閉)ShutdownRegistry - 關停 FileOutputRegistry [PrintWriter的[001_JRat-L​​OG.jrat]] ... JRAT:INFO(十月/ 18 17:15:48826) (JRAT關閉)FileOutputRegistry - closeFileOutputs [PrintWriter的[001_JRat-L​​OG.jrat] JRAT:INFO(十月/ 18 17:15:48826) (JRAT關閉)FileOutputRegistry - 關閉 : 的PrintWriter [001_JRat-L​​OG.jrat] JRAT:INFO(十月/ 18 17:15:48826) (JRAT關閉)FileOutputPrintWriter - 閉JRAT:INFO(十月/ 18 17:15:48826) (JRAT關閉) FileOutputRegistry - 刪除 的PrintWriter [001_JRat-L​​OG.jrat]

有人曾經使用過它在Linux上。我想,因爲我運行這個作爲服務..運行我的應用程序後,我按下停止按鈕以終止我的應用程序[反對可能終止自己的工作完成後,其他應用程序] ..這可能不會使應用程序退出優雅JRAT並且因此不產生傾倒??這僅僅是一個盲目的猜測,雖然。

感謝

PS: 我使用Eclipse的Java版本1.6.0_13

日期: 不可能得到這個工作,而是試圖VisualVM的這工作好。 但是需要配置文件遠程appliaction,[因爲我想分析我的服務和簡單​​的方法的一部分,強調代碼的一部分,並得到其序號是從服務器本身]所以會尋找一些易於使用遠程。

+1

你有沒有考慮過使用jvisualvm?它配備了JDK。 – 2010-10-19 00:47:53

+0

日Thnx ..我試過jvisualvm它工作得很好。但是它不能與遠程應用中使用。該醫生說:「你不能輪廓在遠程主機上運行的應用程序。」 https://visualvm.dev.java.net/gettingstarted.html?Java_VisualVM – codeObserver 2010-10-20 02:50:15

回答

0

你可以嘗試strace的慶典,它安裝上正在使用的應用程序的中介。 strace的bash中可以與可視化器被聯接到啓用遠程實時以及收集到的數據的歷史圖表。

請參考以下問題以獲得更多信息:High Execution time on java methods