-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Statistics-
PostPosted: Wed Jul 21, 2010 3:01 am 
Newbie

Joined: Wed Jul 21, 2010 2:52 am
Posts: 1
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.