Fork me on GitHub

Instrumenting JDBI

The metrics-jdbi module provides a TimingCollector implementation for JDBI, an SQL convenience library.

To use it, just add a InstrumentedTimingCollector instance to your DBI:

final DBI dbi = new DBI(dataSource);
dbi.setTimingCollector(new InstrumentedTimingCollector());

InstrumentedTimingCollector keeps per-SQL-object timing data, as well as general raw SQL timing data.