Javamelody can monitor Java or Java EE application servers in a running environment. And graphically displays: Java memory and Java CPU usage, number of user sessions, number of JDBC connections, and number of executions of HTTP requests, SQL requests, JSP pages and Business interface methods (EJB3, Spring, Guice), average execution time, Percent of errors, and so on. Charts can be viewed by day, week, month, year, or custom time period.
The monitoring effect is shown at the end of this article.
Configuration mode:
1. Download Address: Http://code.google.com/p/javamelody/downloads/list
So far the latest version is 1.47.0, download address: http://code.google.com/p/javamelody/downloads/detail?name=javamelody-1.47.0.zip&can=2 &q=
2. After downloading can extract find Javamelody-1.47.0.jar and Jrobin-1.5.9.1.jar, reference to the project.
3. Configure filter in Web.xml:
[HTML] View plain copy <filter> <filter-name >monitoring</filter-name> <filter-class >net.bull.javamelody.MonitoringFilter</filter-class> <init-param> <param-name>log</param-name> <param-value>true</param-value> </init-param> </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 Project: Open Link: http://For example: http://127.0.0.1:8080/myproj/monitoring
at this point, the basic configuration is complete, with simple performance monitoring, and the following configuration is the integrated configuration of Javamelody and Struts2 and Spring3:
5.javamelody and STRUTS2 integrated when configured:
[HTML] View plain copy <package name= "base namespace="/" extends=" Struts-default "> <result-types> <result-type name= "JSON" class= "Org.apache.struts2.json.JSONResult" /> </result-types> <interceptors > <!-- javamelody --> < Interceptor name= "Monitoring" class= "Net.bull.javamelody.StrutsInterceptor" />