You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Thomas (JIRA)" <ji...@apache.org> on 2013/12/11 11:41:08 UTC

[jira] [Resolved] (DBCP-292) Adds an mbean for exposing metrics around a BasicDataSource via JMX

     [ https://issues.apache.org/jira/browse/DBCP-292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Thomas resolved DBCP-292.
------------------------------

    Resolution: Fixed

It has taken a while but this has now been fixed. In addition to making the BasicDataSource configuration properties available, the connection pool and any statement pools are also available. Combined with the JMX improvements in Pool2 you can now drill down to the point where you can see exactly which statements are in the statement pool, the time the statement was created, the last time it was borrowed etc.

> Adds an mbean for exposing metrics around a BasicDataSource via JMX
> -------------------------------------------------------------------
>
>                 Key: DBCP-292
>                 URL: https://issues.apache.org/jira/browse/DBCP-292
>             Project: Commons Dbcp
>          Issue Type: New Feature
>    Affects Versions: 1.2.2
>            Reporter: David Horne
>            Priority: Minor
>             Fix For: 2.0
>
>         Attachments: BasicDataSourceMBean.patch
>
>
> The attached patch adds an mbean that exposes the following metrics of a BasicDataSource via jmx: numActive, numIdle, maxActive, maxIdle, minIdle & maxWait.
> I have put it in a new package: org.apache.commons.dbcp.management but feel free to put it in any package you see fit.
> If using Spring the bean can be configured a little something like this:
> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
>  ...
> </bean>
> <bean id="dataSourceMBean" class="org.apache.commons.dbcp.management.BasicDataSourceMBean">
> 	<constructor-arg ref="dataSource"/>
> </bean>
> <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
> 	<property name="beans">
> 		<map>
> 			<entry key="DBCP:name=dataSource" value-ref="dataSourceMBean"/>
> 		</map>
> 	</property>
> </bean>



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)