问题描述
在我的Web应用程序中,即使在开始写入响应之前,servlet也需要几秒钟。我想知道,在servlet执行期间调用哪些方法,每个方法需要什么时间。
In my web application a servlet needs multiple seconds even before it starts to write the response. I would like to find out, which methods are called during servlet execution and what time each method takes.
是否已经在Luna版本中包含了一个分析器用于Java EE开发人员的Eclipse IDE ?如何激活?
Is there a profiler already included in the Luna release of Eclipse IDE for Java EE Developers? How do I activate it?
网络上有很多信息可用,但是接缝名称一直都有变化,所以我无法过滤相关的信息。 p>
There is a lot information available on the web, but it seams names change all the time so I have difficulties to filter the relevant.
推荐答案
JVM Monitor 3.8 可以很好的使用Eclipse Luna,而且使用起来也很简单。
JVM Monitor 3.8 works fine with Eclipse Luna and it is also quite simple to use.
- 从eclipse市场下载并安装
- 重新启动eclipse
- 开始您的应用程序
- 通过 窗口打开JVM资源管理器视图>显示视图[>其他]> Java监视器> JVM资源管理器
- 找到您的应用服务器进程,右键单击并选择 开始监控
- 在 属性 视图中,查看具有cpu和内存使用情况的图表
- 选择 CPU li>
- 点击 选择配置式CPU包 (您可以随时使用右键单击更改>属性 )
- 在 属性 标签的右上角点击 CPU分析 (或者可以称为 恢复CPU分析 )
- download and install from eclipse marketplace
- restart eclipse
- start your application
- open JVM Explorer view via window > show view [> other ]> Java Monitor > JVM Explorer
- find your app server process, right click on it and pick Start Monitoring
- you should now land in the Properties view and see graphs with cpu and memory usage
- select the CPU tab
- click on select profiled CPU packages (you can always change them with right click > properties)
- in the top right corner of the Properties tab click on Start CPU Profiling (or it may be called Resume CPU Profiling)
现在,您的调用树应该与您的应用程序交互时填充,您可以分析方法调用及其持续时间。输出应如下所示:
Now your call tree should be populated as you interact with your application and you can analyse the method calls and their duration. The output should look like this:
这篇关于如何在Eclipse EE Luna中配置Java Web应用程序servlet调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!