java Jprofiler 7.2.2 - 如何查看在方法中花费的时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14589070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 16:46:02  来源:igfitidea点击:

Jprofiler 7.2.2 - how do I view time spent in methods

javajprofiler

提问by joneric wennerstrom

I have downloaded the trial version of JProfiler, and am testing it out on a java 1.5 console app. It only shows me memory usage, ie, how many times a java.lang.String was instantiated. I want to see what methods were called and how much time is spent in each method. I have not figured out how to do this in the trial version.

我已经下载了 JProfiler 的试用版,并且正在 java 1.5 控制台应用程序上对其进行测试。它只显示内存使用情况,即实例化 java.lang.String 的次数。我想看看调用了哪些方法以及每个方法花费了多少时间。我还没有想出如何在试用版中做到这一点。

I viewed the following article http://java.dzone.com/articles/jprofiler-your-java-code-could, which shows a menu choice for "Performance Bottle Necks". I don't have this option in my drop down menu. Is this feature disabled in the trial version?

我查看了以下文章 http://java.dzone.com/articles/jprofiler-your-java-code-could,其中显示了“性能瓶颈”的菜单选项。我的下拉菜单中没有这个选项。试用版中是否禁用了此功能?

回答by Ingo Kegel

Activate the CPU view section in the left side bar, then choose the "Hot spots" tab. You might have to start recording CPU data first. If no data has been recorded, there will be a button that tab that allows you to start CPU recording.

激活左侧栏中的 CPU 视图部分,然后选择“热点”选项卡。您可能必须先开始记录 CPU 数据。如果没有记录数据,将有一个按钮,该选项卡允许您开始 CPU 记录。

回答by Neeraj Bansal

  1. Open the CPU view section, now click on the "Call Tree" Tab.
  2. Right click and click on Find.
  3. Now you can start typing your method name that you want to investigate and you will see your method's tree hierarchy.
  4. You can also right click on your method and click on "Set As Root".
  5. Now it will easy to analyze both "Hot Spots" and "Call Graph" after setting method set as root.
  1. 打开 CPU 视图部分,现在单击“调用树”选项卡。
  2. 右键单击并单击“查找”。
  3. 现在您可以开始输入您想要调查的方法名称,您将看到您的方法的树层次结构。
  4. 您也可以右键单击您的方法,然后单击“设置为根”。
  5. 现在,将方法设置为 root 后,可以轻松分析“热点”和“调用图”。

I was using Jprofiler 10.0.3.

我使用的是 Jprofiler 10.0.3。