Hi,
I would like to see the slowest query.
I have set hibernate statistics true and see below values...
09:58:36,002 INFO [StatsMonitor] Statistics[start time=1279686753393,sessions opened=2283,sessions closed=2283,tr ansactions=131,successful transactions=131,optimistic lock failures=0,flushes=131,connections obtained=7187,statem ents prepared=7610,statements closed=7610,second level cache puts=12877,second level cache hits=65406,second level cache misses=6015,entities loaded=10878,entities updated=86,entities inserted=159,entities deleted=0,entities fet ched=4240,collections loaded=1845,collections updated=12,collections removed=0,collections recreated=77,collection s fetched=1843,queries executed to database=569,query cache puts=568,query cache hits=1654,query cache misses=568, max query time=39926]
Max query time is 39 seconds as i see above. Is there any way that i can see the slowest query?
I tried to log it but stats.getQueryExecutionMaxTimeQueryString() returns null.
final Statistics stats = ServicesPlugin.getDefault().getHibernateStats(); stats.setStatisticsEnabled(true);
StatsMonitor.logger.info("Hibernate Statistics"); //$NON-NLS-1$ StatsMonitor.logger.info(stats); StatsMonitor.logger.info("Slowest Query"); //$NON-NLS-1$ StatsMonitor.logger.info(stats.getQueryExecutionMaxTimeQueryString()); StatsMonitor.logger.info(stats.getQueryExecutionMaxTime());
Thanks,
Regards...
|