当前位置:首页 > 开发 > 数据库 > 正文

Druid Srping监控配置

发表于: 2014-12-04   作者:elvis4139   来源:转载   浏览:
摘要: <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="driverClassNam
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="maxActive" value="${db.maxActive}" />
<property name="initialSize" value="${db.initialSize}" />
<property name="maxWait" value="${db.maxWait}" />
<property name="minIdle" value="${db.minIdle}" />
<property name="timeBetweenEvictionRunsMillis" value="${db.timeBetweenEvictionRunsMillis}" />
<property name="minEvictableIdleTimeMillis" value="${db.minEvictableIdleTimeMillis}" />
<property name="testWhileIdle" value="${db.testWhileIdle}" />
<property name="testOnBorrow" value="${db.testOnBorrow}" />
<property name="testOnReturn" value="${db.testOnReturn}" />
<property name="poolPreparedStatements" value="${db.poolPreparedStatements}" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="${db.maxPoolPreparedStatementPerConnectionSize}" />
<property name="filters" value="stat" />
</bean>

<!-- 配置druid监控spring jdbc -->
    <bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor" />
    <bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
        <property name="patterns">
            <list>
            <value>com.xxx.*.controller.*</value>
                <value>com.xxx.*.service.*</value>
                <value>com.xxx.*.dao.*</value>
            </list>
        </property>
    </bean>
    <aop:config proxy-target-class="true">
        <aop:advisor advice-ref="druid-stat-interceptor" pointcut-ref="druid-stat-pointcut" />
    </aop:config>

Druid Srping监控配置

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号