Web application test monitoring execution time--Javasimon

Source: Internet
Author: User
Tags visualvm

The overall performance of using the Jmeter-plugins and VISUALVM monitoring systems was previously described in system performance tuning, and sometimes it is necessary to know how long some specific method calls are consuming to find bottlenecks. VISUALVM can do it, but it's too resource-intensive if you do profiler. Personally feel that Javasimon is a very good choice. Not only can easily monitor the data layer, business layer, the Web layer of the respective access time, but also provides a Web page view statistics and system alarm notification function, very good.
Describe how Javasimon is used in spring-based web systems.

1. Web page statistics, Web pages view and how to notify alerts
<web-app version="2.5" xmlns="Http://java.sun.com/xml/ns/javaee"  xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation=" Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">                          <filter>        <!--Simon Statistics filter -                <filter-name>Simon-filter</filter-name>                <filter-class>Org.javasimon.javaee.SimonServletFilter</filter-class>                <!--optional --                <init-param>                        <param-name>Prefix</param-name>                        <param-value>Com.cloud.web</param-value>                </init-param>                <!--Optional basic Plain-text console --                <init-param>                        <param-name>Console-path</param-name>                        <param-value>/simon-filter</param-value>                </init-param>                <!--optional, thresholds needed to be reported-                <init-param>                        <param-name>Report-threshold-ms</param-name>                        <param-value>1000</param-value>                </init-param>                <!--optional, alarm-displays to standard output and can be customized for your report--                <init-param>                        <param-name>Request-reporter-class</param-name>                        <param-value>Org.javasimon.javaee.reqreporter.StandardRequestReporter</param-value>                </init-param>                <!--Optional, stopwatchsource instance--                <init-param>                        <param-name>Stopwatch-source-props</param-name>                        <param-value>Includehttpmethodname=always</param-value>                </init-param>        </filter>        <!--Web Console displays Web statistics, accessing/simon-console view--        <filter>                <filter-name>Simon-console-filter</filter-name>                <filter-class>Org.javasimon.console.SimonConsoleFilter</filter-class>                <init-param>                        <param-name>Url-prefix</param-name>                        <param-value>/simon-console</param-value>                </init-param>        </filter>        <!--Most cases the Web view console does not need to be monitored, note the filter order -        <filter-mapping>                <filter-name>Simon-console-filter</filter-name>                <url-pattern>/*</url-pattern>        </filter-mapping>        <filter-mapping>                <filter-name>Simon-filter</filter-name>                <url-pattern>/*</url-pattern>        </filter-mapping></Web-app>
2. Spring configuration file

Note that this is only valid for the bean defined in the Spring configuration file (the controller in SPRING-MVC is not valid)

       <bean id= "monitoringinterceptor" class=" Org.javasimon.spring.MonitoringInterceptor "/>        <aop:config>                <!--name of the class or interface --                <aop:pointcut id="Monitoringpointcut" expression="Execution (* com.cloud.service.serviceimpl.* (..)) " />                <aop:advisor advice-ref= "monitoringinterceptor" pointcut-ref=" Monitoringpointcut "/>        </aop:config>
3. JDBC Layer

Use Simon's JDBC driver instead of the official driver, or package DataSource to achieve the goal.

You can view different layer access times in your Web app to locate system bottlenecks.

Web application test monitoring execution time--Javasimon

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.