Javamelody can monitor Java or Java EE application servers in QA and actual running production environments. The following charts show the usage of Java memory and Java CPU, the number of user sessions, and the number of JDBC connections, and the number of HTTP requests, SQL requests, JSP pages, and business interface methods (ejb3, spring, and guice), average execution time, and error percentage. Charts can be viewed by day, week, month, year, or custom time period.
The configuration is as follows:
The deployment steps are as follows:
1: first need to download two jar packages, are javamelody-1.16.0.jar, jrobin-1.5.9.1.jar, the first jar package download address is: http://code.google.com/p/javamelody/downloads/detail? Name = javamelody-1.16.0.jar & can = 2 & Q =
The second jar package needs to first download the javamelody-1.16.0.war, and then in the decompressed lib can find the package, the war package is: http://code.google.com/p/javamelody/downloads/detail? Name = javamelody-1.16.0.war & can = 2 & Q =
2: Put the two jar packages you just obtained into the lib directory of your project.
3: Configure in the web. xml configuration file. The configuration content is as follows:
<Filter>
<Filter-Name> Monitoring </filter-Name>
<Filter-class> net. Bull. javamelody. monitoringfilter </filter-class>
</Filter>
<Filter-mapping>
<Filter-Name> Monitoring </filter-Name>
<URL-pattern>/* </url-pattern>
</Filter-mapping>
<Listener>
<Listener-class> net. Bull. javamelody. sessionlistener </listener-class>
</Listener>
4: restart the project and open the connection http: // localhost: 8080/monitoring/to view the monitoring chart.
Another method:
1. Download zip package from http://code.google.com/p/javamelody/downloads/List
2. decompress and copy javamelody. War to the Tomcat release directory.
3. Add the following code to the Monitored project web. xml:
- <Filter>
- <Filter-Name> Monitoring </filter-Name>
- <Filter-class> net. Bull. javamelody. monitoringfilter </filter-class>
- </Filter>
- <Filter-mapping>
- <Filter-Name> Monitoring </filter-Name>
- <URL-pattern>/* </url-pattern>
- </Filter-mapping>
- <Listener>
- <Listener-class> net. Bull. javamelody. sessionlistener </listener-class>
- </Listener>
4. Copy javamelody. jar to the lib directory of the monitored project.
5. Start the Tomcat application server and access the javamelody application, such as http: // localhost: 8080/javamelody.
6. perform the following settings based on the actual situation:
7. Click Add.
Original Website:
Http://liuyes.javaeye.com/blog/691752