Hi there,
I'm just using this tool on my company's application and not sure how to understand the information showed on logs. This tool works for each session opened to the application?.
return ((HibernateSessionProxy) entityManager.getDelegate()).getSessionFactory().getStatistics();
So if yes, the logs in my application always sizing up exponential every times we throw the statistics to log. It's correct?, I think no, but just want confirm.
Example:
2011-01-13 13:59:29,531 INFO [STDOUT] (ajp-0.0.0.0-8009-7) ******************** 2011-01-13 13:59:29,531 INFO [STDOUT] (ajp-0.0.0.0-8009-7) Hibernate Statistics 2011-01-13 13:59:29,531 INFO [STDOUT] (ajp-0.0.0.0-8009-7) ******************** 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) Logging statistics.... 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) start time: 1294922489333 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) sessions opened: 36 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) sessions closed: 25 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) transactions: 585 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) successful transactions: 585 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) optimistic lock failures: 0 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) flushes: 742 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) connections obtained: 59894 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) statements prepared: 59894 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) statements closed: 59894 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) second level cache puts: 0 2011-01-13 13:59:29,531 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) second level cache hits: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) second level cache misses: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) entities loaded: 32748 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) entities updated: 164 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) entities inserted: 48 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) entities deleted: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) entities fetched (minimize this): 10277 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) collections loaded: 9128 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) collections updated: 151 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) collections removed: 6 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) collections recreated: 6 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) collections fetched (minimize this): 9080 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) queries executed to database: 40169 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) query cache puts: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) query cache hits: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) query cache misses: 0 2011-01-13 13:59:29,532 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-7) max query time: 2554ms
After 15 mins:
2011-01-13 14:19:14,664 INFO [STDOUT] (ajp-0.0.0.0-8009-6) ******************** 2011-01-13 14:19:14,664 INFO [STDOUT] (ajp-0.0.0.0-8009-6) Hibernate Statistics 2011-01-13 14:19:14,664 INFO [STDOUT] (ajp-0.0.0.0-8009-6) ******************** 2011-01-13 14:19:14,664 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) Logging statistics.... 2011-01-13 14:19:14,664 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) start time: 1294922489333 2011-01-13 14:19:14,664 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) sessions opened: 57 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) sessions closed: 41 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) transactions: 1258 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) successful transactions: 1258 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) optimistic lock failures: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) flushes: 1591 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) connections obtained: 61031 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) statements prepared: 61031 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) statements closed: 61031 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) second level cache puts: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) second level cache hits: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) second level cache misses: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) entities loaded: 38122 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) entities updated: 365 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) entities inserted: 57 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) entities deleted: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) entities fetched (minimize this): 10296 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) collections loaded: 9149 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) collections updated: 351 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) collections removed: 6 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) collections recreated: 6 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) collections fetched (minimize this): 9095 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) queries executed to database: 41028 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) query cache puts: 0 2011-01-13 14:19:14,665 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) query cache hits: 0 2011-01-13 14:19:14,666 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) query cache misses: 0 2011-01-13 14:19:14,666 INFO [org.hibernate.stat.StatisticsImpl] (ajp-0.0.0.0-8009-6) max query time: 2554ms
Any infos or sugerence would be appreciate, thanks in advance.
Cristian M.
|