grails connection pool information

429 views
Skip to first unread message

Martin Gee

unread,
Nov 11, 2010, 4:57:57 PM11/11/10
to javamelody
I've been trying out the Grails plugin. Which looks awesome. BTW.

Is there a way to see the connection pool size, used connections etc.
Seems like there is a lot good information on the BasicDatasource that
should be graphed and monitored.

evernat

unread,
Nov 12, 2010, 1:41:51 PM11/12/10
to javamelody
Hi,

Yes, you should see "user jdbc connections" and "active jdbc
connections".
And you should see properties of BasicDataSource in the details of
"System informations".

This is done in Grails by this post-processor:
http://plugins.grails.org/grails-grails-melody/trunk/src/groovy/GrailsDataSourceBeanPostProcessor.groovy
which is initialized by doWithSpring in:
http://plugins.grails.org/grails-grails-melody/trunk/GrailsMelodyGrailsPlugin.groovy


What kind of datasource is it and can you share the configuration?

Do you use JndiObjectFactoryBean for the datasource?
(GrailsDataSourceBeanPostProcessor may not work currently with
JndiObjectFactoryBean)


Thanks, Emeric

evernat

unread,
Nov 12, 2010, 1:44:40 PM11/12/10
to javamelody
I should have said:
Graphics of "used jdbc connections" and of "active jdbc connections",
but this was lost somehow.


On 12 nov, 19:41, evernat <ever...@free.fr> wrote:
> Hi,
>
> Yes, you should see "user jdbc connections" and "active jdbc
> connections".
> And you should see properties of BasicDataSource in the details of
> "System informations".
>
> This is done in Grails by this post-processor:http://plugins.grails.org/grails-grails-melody/trunk/src/groovy/Grail...
> which is initialized by doWithSpring in:http://plugins.grails.org/grails-grails-melody/trunk/GrailsMelodyGrai...

Martin Gee

unread,
Nov 12, 2010, 4:45:31 PM11/12/10
to javamelody
I'm using the out of the box DBCP that grails uses, no JNDI. It
looks like the grails-plugin does the post-processor for me.

I get all the SQL tracing and such. Just no data in the connection
graphs. I'm also thinking it'd be good to add some DBCP specific /
other graphs since it's the defacto with grails.

Here is my Datasource:
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://localhost/${appName}"
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
username = "xxxxx"
password = "xxxxx"

properties {
testOnBorrow = true
validationQuery = "select 1"

Emeric Vernat

unread,
Nov 25, 2010, 6:34:11 PM11/25/10
to javam...@googlegroups.com
Hi Martin,

Your grails dataSource looks ok.
The sql monitoring seems to work, because you have "SQL tracing" and so
there is no reason that you don't have values in the connections graphics.
But note that "used connections" and "active connections" are collected
only once each minute.
So if your application is not much used yet, it may be that values for
these graphics are 0 when javamelody looks at them.

In summary, just wait a bit until your application has more sql executions.

bye, Emeric


Le 12/11/2010 22:45, Martin Gee a �crit :

Reply all
Reply to author
Forward
0 new messages