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