Monitoring the Performance of Your Tomcat Application Server Using JavaMelody

JavaMelody是一款开源(LGPL)的应用程序,用于监控Java及JavaEE应用服务器在QA和生产环境的表现。它主要通过请求统计数据及趋势图表来帮助改善应用程序性能,提供平均响应时间和执行次数等关键指标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Javamelody is an opensource (LGPL) application to monitor Java or Java EE application servers in QA and production environments.

JavaMelody is mainly based on statistics of requests and on evolution charts.

(Extract from the Javamelody home page)

  • It allows to improve applications in QA and production
  • Give facts about the average response times and number of executions
  • Make decisions when trends are bad, before problems become too serious
  • Optimize based on the more limiting response times
  • Find the root causes of response times
  • Verify the real improvement after optimization

It includes summary charts showing the evolution over time of the following indicators:

  • Number of executions, mean execution times and percentage of errors of http requests, sql requests, jsp pages or methods of business façades (if EJB3, Spring or Guice)
  • Java memory
  • Java CPU
  • Number of user sessions
  • Number of jdbc connections

These charts can be viewed on the current day, week, month, year or custom period.
You can even execute garbage collection to free resources, or view / invalidate http sessions.

Setting up Javamelody on your server

*Step 1: *
Download the javamelody-1.36.0.zip zip file.
Now, unzip, and add copy the files javamelody.jar and jrobin-x.jar into the in the lib directory of Tomcat.

*Step 2: *
Add the following lines in the web.xml file of the conf directory of Tomcat (and not in the WEB-INF/web.xml files of the webapps).

web.xml.snippet
<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>

Once this is done, all you need to do is restart the application. Once the application is up, navigate to http://<host>/<context>/monitoring url to view a whole set of interesting data.

The full instrcutions are available here.

What does the Javamelody monitoring page look like?

Attached below is a screenshot of my Javamelody monitoring page. Note that this screenshot is of a development environment with no data and just a single user.

Disclaimer : I was only able to try out Javamelody on a development environment. Therefore, implementers are advised to test out Javamelody on a trial environment before moving it into the production server/s.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值