ActiveJDBC has had a truly little hidden(till now) gem for reporting on query performance. It is called Statistics Queue. If configured, it will collect statistical information on queries executed and then make it available for reporting. We built a simple UI page that helps us see all the queries recorded in the queue. This page makes it easy to sort all queries by total, average, minimum and maximum times they took to execute. The API to get the reporting is simple:
List statistics = Registry.instance().getStatisticsQueue().getReportSortedBy("avg");
The argument for the method
getReportSortedBy("avg") can be either one of these: "total", "avg", "min", "max", "count", which makes this easy to sort your queries any way you like.
This tool helps to get to the bottom of performance problems.
For more information, take a look at Statistics Reporting page.