简体   繁体   English

使用JProfiler分析Maven Web应用程序

[英]Profiling maven web application with JProfiler

I know I can profile my application with JProfiler using ANT target. 我知道我可以使用ANT目标使用JProfiler来分析我的应用程序。 Is there a way to do the same with maven?? 有没有办法对Maven做同样的事情?
Actually maven allows to run ant targets, using maven-ant plugin, but I'd like to perform such profiling without ANT. 实际上,maven允许使用maven-ant插件运行ant目标,但我想在没有ANT的情况下执行此类性能分析。

Thanks in advance! 提前致谢!

The JVM arguments normally used to enable profiling of the application can be added to the MAVEN_OPTS environment variable. 可以将通常用于启用应用程序概要分析的JVM参数添加到MAVEN_OPTS环境变量中。 These arguments will also be used for all applications started by Maven. 这些参数还将用于Maven启动的所有应用程序。

As an example my MAVEN_OPTS to enable remote debugging on a Jetty instance started by Maven: 例如,我的MAVEN_OPTS可以在Maven启动的Jetty实例上启用远程调试:

set MAVEN_OPTS = "-Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000"

It is driven by JVM arguments and some environment entry. 它由JVM参数和某些环境条目驱动。 See http://resources.ej-technologies.com/jprofiler/help/doc/ for more details at "Requirements for remote profiling" chapter. 有关更多详细信息,请参见http://resources.ej-technologies.com/jprofiler/help/doc/ There is the remote application profiling wizard, and it also tells you what to do exactly. 有一个远程应用程序分析向导,它还告诉您确切地做什么。 You should do the following: 您应该执行以下操作:

1.4 JVM LINUX: LD_LIBRARY_PATH environment variable should contain profiler/bin 1.4 JVM LINUX:LD_LIBRARY_PATH环境变量应包含分析器/ bin

1.4 JVM Windows: PATH environment variable should contain profiler/bin 1.4 JVM Windows:PATH环境变量应包含事件探查器/ bin

1.4 Both: Add -Xrunjprofiler -Xbootclasspath/a:{path to agent.jar} JVM arguments 1.4两者:添加-Xrunjprofiler -Xbootclasspath / a:{agent.jar的路径} JVM参数

Above 1.5: -agentpath:[path to jprofilerti library] should be added to JVM arguments 高于1.5:-agentpath:[jprofilerti库的路径]应该添加到JVM参数中

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

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