文档在此 https://github.com/javamelody/javamelody/wiki/UserGuide#javamelody-setup
(1)maven的pom.xml里增加
<!-- javamelody-core --> <dependency> <groupId>net.bull.javamelody</groupId> <artifactId>javamelody-core</artifactId> <version>1.60.0</version> </dependency>
(2)web.xml里增加:
<filter> <filter-name>javamelody</filter-name> <filter-class>net.bull.javamelody.MonitoringFilter</filter-class> <async-supported>true</async-supported> </filter> <filter-mapping> <filter-name>javamelody</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>ASYNC</dispatcher> </filter-mapping> <listener> <listener-class>net.bull.javamelody.SessionListener</listener-class> </listener>
(3)访问http://<host>/<context>/monitoring就行了
能看内存图,cpu图,线程列表,线程dump啥的,简单好用 还能看jdbc,但是得用jndi什么的,没搞, 反正我用的druid连接池,也能看。
|