How to profile a Java web application servlet call in Eclipse EE Luna

杀马特。学长 韩版系。学妹 提交于 2019-12-03 11:16:50

问题


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.

Is there a profiler already included in the Luna release of Eclipse IDE for Java EE Developers? How do I activate it?

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.


回答1:


JVM Monitor 3.8 works fine with Eclipse Luna and it is also quite simple to use.

  1. download and install from eclipse marketplace
  2. restart eclipse
  3. start your application
  4. open JVM Explorer view via window > show view [> other ]> Java Monitor > JVM Explorer
  5. find your app server process, right click on it and pick Start Monitoring
  6. you should now land in the Properties view and see graphs with cpu and memory usage
  7. select the CPU tab
  8. click on select profiled CPU packages (you can always change them with right click > properties)
  9. 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:



来源:https://stackoverflow.com/questions/25731711/how-to-profile-a-java-web-application-servlet-call-in-eclipse-ee-luna

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!