About the configuration of Javamelody

Source: Internet
Author: User

One: Frontier

Here I learned how to use open source, but also for the first time to contact the open-source framework for performance detection, Javamelody is a performance test, just look at the time I do not know anything, but their contact, just know a little about the idea. below to record!

II: javamelody Simple Configuration

Introduce the following jar package into the Pom.xml

<dependency>          <groupId>net.bull.javamelody</groupId>          <artifactId> javamelody-core</artifactid>          <version>1.55.  0</version>      </dependency>

The following is added in the configuration file.

Web. xml:

<context-param>        <param-name>contextConfigLocation</param-name>        <param-value>             classpath:net/bull/javamelody/monitoring-spring.xml        </param-value>   </context-param>
Listeners and filters

<filter>
<filter-name>monitoring</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<init-param>
<param-name>url-exclude-pattern</param-name>
<param-value>/resource/.*</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>

In the dependency injection *.xml, configure the following

<bean id="Facademonitoringadvisor" class="Net.bull.javamelody.MonitoringSpringAdvisor"> <property name="pointcut"> <beanclass="Org.springframework.aop.support.JdkRegexpMethodPointcut"> <property name="pattern"Value=". *service.*"/> </bean> </property> </bean>

Add these items and your project will allow you to detect them.

You can use this address to access http://localhost:8080/test/monitoring.

Such as:

This is the chart of how to view efficiency, etc.

Three: summary

On the road of it every step is a big step, now can use the case, then to the root of the bottom, now I still on the road. Effort is what I can do now, and experience is very important. Now it's time to take a step on the road to the top. Go!!!

About the configuration of Javamelody

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.