How often have you been very busy tracking Hibernate's performance and runtime behaviour? At least I have spent days, weeks and months reading DEBUG log files and browsing through statistics. The good thing about Hibernate is that it has useful logging and a very powerful statistics feature. But the bad thing is that there is, until now, no tool that reads this data AND puts it together in an easy to read and understand manner.

This is where Statsviewer steps in. Statsviewer is an open source web application which is being deployed next to your running application. The application then reads your JNDI global namespace and detects any EntityManagerFactories or SessionFactories that are bound to the JNDI tree. From there on Stasviewer reads and evaluates the statistics that Hibernate is recording (if enabled) at runtime. Finally you can have a look at them through a web frontend.

In addition to that Statsviewer is also able to parse Hibernate's SQL and type debug logging and display you a summary of which SQLs have been sent to the database. The candy about this feature is Statsviewer's ability to replace the question marks from the prepared statements by their real values giving you a clear sight about which queries might be good candidates for a query cache or which queries are executed to often retrieving the same data.

Core Features

Statsviewer is currently in Beta Status but it already comes with many useful and stable features:

  • Persistence Unit Statistics
  • Entity Statistics
  • Second Level Cache Statistics
  • Query Statistics
  • SQL Log Statistics (gathered from Hibernate's SQL Log)

Tested Environments

Currently Statsviewer has been tested with Hibernate as a JPA Persistence Provider on JBoss 4.2.0 GA.