JDBCSpy – What’s been happening.
15 Mar 2008So I’ve been working off and on over the past 6 months on a little side project, JDBCSpy. I’ve mentioned it previously so this post is just a little update.
It’s far from my day job and really just serves as a bit of an outlet. You’re free to argue about whether it’s a creative outlet or not The project stemmed from code written during one of hack days and has grown organically from there.
Essentially the goals of the project are as follows:
- Provide an interface to easily gather statistics from a JDBC connection. Currently this is accomplishable in two ways.
- The delegating JDBC driver will write all executing queries to a log file alongside some basic statistical information (ie. how long it spent executing).
- More interestingly, the delegating JDBC driver also registers an MBean that exposes a slightly more comprehensive set of statistics (ie. how much time has been spent executing sql, # of queries executed, etc.)
- There’s also an example implementation of a TestNG listener that will track JDBC statistics on a per-test method basis.
- Provide a means of visualizing the gathered statistics.
- There is a JDBCSpy Viewer under development. It has the ability to connect real-time to the JDBCSpy MBean and visualize activity. It can also reply a previously logged session by loading the JDBCSpy log file. It makes use of a bunch of the Orson and JFreeChart work so things don’t look half bad.
I’ve been using Maven for all build activities which satisfies one of the non-functional objectives.
If pressed, I’d say things are available in a beta-quality form. The code isn’t perfect nor particularly tuned. Most of the (recent) time I’ve spent on the project has been focused towards GUI refactoring. There’s plenty of more work to do on the JDBC driver side but it’s more or less taken a back seat right now. Part of the reason for this lies in the fact that there’s a few other projects that do something similar for JDBC logging.
Click here for a screenshot of the current viewer.
I’ll probably be adding some basic Groovy support (to enable user-defined filtering) to the viewer in the next commit or two. More or less just for kicks but it would also provide an opportunity to play a bit more with the language.
Cheers.