简体   繁体   English

VisualVM,用于分析在Tomcat上运行的应用程序

[英]VisualVM for profiling an application running on Tomcat

I have apache tomcat 7 running on local and a web application deployed as .war file to this server. 我在本地运行的apache tomcat 7和作为.war文件部署到此服务器的Web应用程序。 I am trying to use visualvm to profile the application but so far I am only able to profile tomcat itself. 我正在尝试使用visualvm来分析应用程序,但到目前为止我只能分析tomcat本身。

I am able to see everything about tomcat in the interface and there are absolutely no problems. 我能够在界面中看到关于tomcat的所有内容,并且绝对没有问题。 I am able to see indvidiual tomcat functions as well which are of no meaning to me. 我能够看到独立的tomcat函数,这对我来说毫无意义。

What I want to see is the execution time of the functions of my deployed web application, in other words my own code. 我想看到的是我部署的Web应用程序的功能的执行时间,换言之,我自己的代码。 But I am unable to do that? 但我无法做到这一点? Has anyone ever managed to do this profiling? 有没有人设法做这个分析? Do I need to set a JMX connections or something with my deployed application? 我是否需要使用已部署的应用程序设置JMX连接? Below you can find my screen which I am able to profile tomcat functions. 下面你可以找到我能够描述tomcat功能的屏幕。

我的VisualVM屏幕,我能够配置tomcat

You can filter methods displayed in "profiler". 您可以过滤“profiler”中显示的方法。 but what you want is "sampler". 但你想要的是“采样器”。

Here is what you should do. 这是你应该做的。

Before you run sampler. 在运行采样器之前。 You must check the "settings" checkbox on right of profiling window. 您必须选中性能分析窗口右侧的“设置”复选框。

It will show you settings where you can write what packages should be profiled. 它将显示您可以编写应分析哪些包的设置。

for example: 例如:

com.myCompany.module.* com.myCompany.module。*

探查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM