Plugins You can find out about all the publicly available Grails plugins.

Hibernate Statistics

  • Authors: Mike Hugo
0 vote
compile "org.grails.plugins:hibernate-stats:1.1"




Enables Hibernate Statistics capture and exposes an MBean

To view the stats in a browser, browse to http://HOST/APP_NAME/hibernateStats/

Stats collection is turned off by default. To turn it on, browse to the controller provided by the plugin (http://HOST/APP_NAME/hibernateStats/) and click the link for "Turn Stats Collection On". You can also change the default by adding an entry in Config.groovy: hibernateStats.enabled = true

The MBean is not exposed by default - to expose the MBean, add this to your application Config.groovy: hibernateStats.exposeMBean = true

The plugin adds a dynamic method to your domain classes (getEntityStats) that will return the entity statistics for that particular domain class. For an example, see the HibernateStatsController entityStats action

Hibernate Stats was written as an exercise for an article on how to write a Grails Plugin for the February 2009 edition of Groovy Mag (see