Java Web 服务器性能监控工具 JavaMelody

1、maven 依赖

<dependency>
    <groupId>net.bull.javamelodygroupId>
    <artifactId>javamelody-coreartifactId>
    <version>1.58.0version>
dependency>
<dependency>
    <groupId>org.jrobingroupId>
    <artifactId>jrobinartifactId>
    <version>1.5.9version>
dependency>

jetty 服务器插件

<plugin>
    <groupId>org.mortbay.jettygroupId>
    <artifactId>maven-jetty-pluginartifactId>
    <configuration>
        <scanIntervalSeconds>10scanIntervalSeconds>
        <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                <port>8888port>
            connector>
        connectors>
        <contextPath>/contextPath>
    configuration>
plugin>

2、web.xml 里面配置过滤器和监听器

<filter>
    <filter-name>monitoringfilter-name>
    <filter-class>net.bull.javamelody.MonitoringFilterfilter-class>
filter>
<filter-mapping>
    <filter-name>monitoringfilter-name>
    <url-pattern>/*url-pattern>
filter-mapping>
<listener>
    <listener-class>net.bull.javamelody.SessionListenerlistener-class>
listener>

3、在浏览栏里输入 http://127.0.0.1:8888/monitoring
大功告成!

参考资料:
java web服务器性能监控工具JavaMelody - 梦寻千古的专栏 - 博客频道 - CSDN.NET
http://blog.csdn.net/greecezeus/article/details/16843691

你可能感兴趣的:(Java Web 服务器性能监控工具 JavaMelody)