Package org.hibernate.stat
Class ConcurrentStatisticsImpl
- java.lang.Object
-
- org.hibernate.stat.ConcurrentStatisticsImpl
-
- All Implemented Interfaces:
org.hibernate.stat.Statistics,org.hibernate.stat.StatisticsImplementor
public class ConcurrentStatisticsImpl extends java.lang.Object implements org.hibernate.stat.Statistics, org.hibernate.stat.StatisticsImplementorImplementation ofStatistics, as well asStatisticsImplementor, based on thejava.util.concurrentpackage introduced in Java 5.
-
-
Constructor Summary
Constructors Constructor Description ConcurrentStatisticsImpl()ConcurrentStatisticsImpl(org.hibernate.engine.SessionFactoryImplementor sessionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()reset all statisticsvoidcloseSession()voidcloseStatement()voidconnect()voiddeleteEntity(java.lang.String entityName)voidendTransaction(boolean success)voidfetchCollection(java.lang.String role)voidfetchEntity(java.lang.String entityName)voidflush()longgetCloseStatementCount()longgetCollectionFetchCount()longgetCollectionLoadCount()longgetCollectionRecreateCount()longgetCollectionRemoveCount()java.lang.String[]getCollectionRoleNames()Get the names of all collection rolesorg.hibernate.stat.CollectionStatisticsgetCollectionStatistics(java.lang.String role)Get collection statistics per rolelonggetCollectionUpdateCount()longgetConnectCount()longgetEntityDeleteCount()longgetEntityFetchCount()longgetEntityInsertCount()longgetEntityLoadCount()java.lang.String[]getEntityNames()Get the names of all entitiesorg.hibernate.stat.EntityStatisticsgetEntityStatistics(java.lang.String entityName)find entity statistics per namelonggetEntityUpdateCount()longgetFlushCount()longgetOptimisticFailureCount()longgetPrepareStatementCount()java.lang.String[]getQueries()Get all executed query stringslonggetQueryCacheHitCount()longgetQueryCacheMissCount()longgetQueryCachePutCount()longgetQueryExecutionCount()longgetQueryExecutionMaxTime()java.lang.StringgetQueryExecutionMaxTimeQueryString()org.hibernate.stat.QueryStatisticsgetQueryStatistics(java.lang.String queryString)Query statistics from query string (HQL or SQL)longgetSecondLevelCacheHitCount()longgetSecondLevelCacheMissCount()longgetSecondLevelCachePutCount()java.lang.String[]getSecondLevelCacheRegionNames()Get all second-level cache region namesorg.hibernate.stat.SecondLevelCacheStatisticsgetSecondLevelCacheStatistics(java.lang.String regionName)Second level cache statistics per regionlonggetSessionCloseCount()longgetSessionOpenCount()longgetStartTime()longgetSuccessfulTransactionCount()longgetTransactionCount()voidinsertEntity(java.lang.String entityName)booleanisStatisticsEnabled()Are statistics loggedvoidloadCollection(java.lang.String role)voidloadEntity(java.lang.String entityName)voidlogSummary()log in info level the main statisticsvoidopenSession()voidoptimisticFailure(java.lang.String entityName)voidprepareStatement()voidqueryCacheHit(java.lang.String hql, java.lang.String regionName)voidqueryCacheMiss(java.lang.String hql, java.lang.String regionName)voidqueryCachePut(java.lang.String hql, java.lang.String regionName)voidqueryExecuted(java.lang.String hql, int rows, long time)voidrecreateCollection(java.lang.String role)voidremoveCollection(java.lang.String role)voidsecondLevelCacheHit(java.lang.String regionName)voidsecondLevelCacheMiss(java.lang.String regionName)voidsecondLevelCachePut(java.lang.String regionName)voidsetStatisticsEnabled(boolean b)Enable statistics logs (this is a dynamic parameter)java.lang.StringtoString()voidupdateCollection(java.lang.String role)voidupdateEntity(java.lang.String entityName)
-
-
-
Method Detail
-
clear
public void clear()
reset all statistics- Specified by:
clearin interfaceorg.hibernate.stat.Statistics
-
openSession
public void openSession()
- Specified by:
openSessionin interfaceorg.hibernate.stat.StatisticsImplementor
-
closeSession
public void closeSession()
- Specified by:
closeSessionin interfaceorg.hibernate.stat.StatisticsImplementor
-
flush
public void flush()
- Specified by:
flushin interfaceorg.hibernate.stat.StatisticsImplementor
-
connect
public void connect()
- Specified by:
connectin interfaceorg.hibernate.stat.StatisticsImplementor
-
loadEntity
public void loadEntity(java.lang.String entityName)
- Specified by:
loadEntityin interfaceorg.hibernate.stat.StatisticsImplementor
-
fetchEntity
public void fetchEntity(java.lang.String entityName)
- Specified by:
fetchEntityin interfaceorg.hibernate.stat.StatisticsImplementor
-
getEntityStatistics
public org.hibernate.stat.EntityStatistics getEntityStatistics(java.lang.String entityName)
find entity statistics per name- Specified by:
getEntityStatisticsin interfaceorg.hibernate.stat.Statistics- Parameters:
entityName- entity name- Returns:
- EntityStatistics object
-
updateEntity
public void updateEntity(java.lang.String entityName)
- Specified by:
updateEntityin interfaceorg.hibernate.stat.StatisticsImplementor
-
insertEntity
public void insertEntity(java.lang.String entityName)
- Specified by:
insertEntityin interfaceorg.hibernate.stat.StatisticsImplementor
-
deleteEntity
public void deleteEntity(java.lang.String entityName)
- Specified by:
deleteEntityin interfaceorg.hibernate.stat.StatisticsImplementor
-
getCollectionStatistics
public org.hibernate.stat.CollectionStatistics getCollectionStatistics(java.lang.String role)
Get collection statistics per role- Specified by:
getCollectionStatisticsin interfaceorg.hibernate.stat.Statistics- Parameters:
role- collection role- Returns:
- CollectionStatistics
-
loadCollection
public void loadCollection(java.lang.String role)
- Specified by:
loadCollectionin interfaceorg.hibernate.stat.StatisticsImplementor
-
fetchCollection
public void fetchCollection(java.lang.String role)
- Specified by:
fetchCollectionin interfaceorg.hibernate.stat.StatisticsImplementor
-
updateCollection
public void updateCollection(java.lang.String role)
- Specified by:
updateCollectionin interfaceorg.hibernate.stat.StatisticsImplementor
-
recreateCollection
public void recreateCollection(java.lang.String role)
- Specified by:
recreateCollectionin interfaceorg.hibernate.stat.StatisticsImplementor
-
removeCollection
public void removeCollection(java.lang.String role)
- Specified by:
removeCollectionin interfaceorg.hibernate.stat.StatisticsImplementor
-
getSecondLevelCacheStatistics
public org.hibernate.stat.SecondLevelCacheStatistics getSecondLevelCacheStatistics(java.lang.String regionName)
Second level cache statistics per region- Specified by:
getSecondLevelCacheStatisticsin interfaceorg.hibernate.stat.Statistics- Parameters:
regionName- region name- Returns:
- SecondLevelCacheStatistics
-
secondLevelCachePut
public void secondLevelCachePut(java.lang.String regionName)
- Specified by:
secondLevelCachePutin interfaceorg.hibernate.stat.StatisticsImplementor
-
secondLevelCacheHit
public void secondLevelCacheHit(java.lang.String regionName)
- Specified by:
secondLevelCacheHitin interfaceorg.hibernate.stat.StatisticsImplementor
-
secondLevelCacheMiss
public void secondLevelCacheMiss(java.lang.String regionName)
- Specified by:
secondLevelCacheMissin interfaceorg.hibernate.stat.StatisticsImplementor
-
queryExecuted
public void queryExecuted(java.lang.String hql, int rows, long time)- Specified by:
queryExecutedin interfaceorg.hibernate.stat.StatisticsImplementor
-
queryCacheHit
public void queryCacheHit(java.lang.String hql, java.lang.String regionName)- Specified by:
queryCacheHitin interfaceorg.hibernate.stat.StatisticsImplementor
-
queryCacheMiss
public void queryCacheMiss(java.lang.String hql, java.lang.String regionName)- Specified by:
queryCacheMissin interfaceorg.hibernate.stat.StatisticsImplementor
-
queryCachePut
public void queryCachePut(java.lang.String hql, java.lang.String regionName)- Specified by:
queryCachePutin interfaceorg.hibernate.stat.StatisticsImplementor
-
getQueryStatistics
public org.hibernate.stat.QueryStatistics getQueryStatistics(java.lang.String queryString)
Query statistics from query string (HQL or SQL)- Specified by:
getQueryStatisticsin interfaceorg.hibernate.stat.Statistics- Parameters:
queryString- query string- Returns:
- QueryStatistics
-
getEntityDeleteCount
public long getEntityDeleteCount()
- Specified by:
getEntityDeleteCountin interfaceorg.hibernate.stat.Statistics- Returns:
- entity deletion count
-
getEntityInsertCount
public long getEntityInsertCount()
- Specified by:
getEntityInsertCountin interfaceorg.hibernate.stat.Statistics- Returns:
- entity insertion count
-
getEntityLoadCount
public long getEntityLoadCount()
- Specified by:
getEntityLoadCountin interfaceorg.hibernate.stat.Statistics- Returns:
- entity load (from DB)
-
getEntityFetchCount
public long getEntityFetchCount()
- Specified by:
getEntityFetchCountin interfaceorg.hibernate.stat.Statistics- Returns:
- entity fetch (from DB)
-
getEntityUpdateCount
public long getEntityUpdateCount()
- Specified by:
getEntityUpdateCountin interfaceorg.hibernate.stat.Statistics- Returns:
- entity update
-
getQueryExecutionCount
public long getQueryExecutionCount()
- Specified by:
getQueryExecutionCountin interfaceorg.hibernate.stat.Statistics
-
getQueryCacheHitCount
public long getQueryCacheHitCount()
- Specified by:
getQueryCacheHitCountin interfaceorg.hibernate.stat.Statistics
-
getQueryCacheMissCount
public long getQueryCacheMissCount()
- Specified by:
getQueryCacheMissCountin interfaceorg.hibernate.stat.Statistics
-
getQueryCachePutCount
public long getQueryCachePutCount()
- Specified by:
getQueryCachePutCountin interfaceorg.hibernate.stat.Statistics
-
getFlushCount
public long getFlushCount()
- Specified by:
getFlushCountin interfaceorg.hibernate.stat.Statistics- Returns:
- flush
-
getConnectCount
public long getConnectCount()
- Specified by:
getConnectCountin interfaceorg.hibernate.stat.Statistics- Returns:
- session connect
-
getSecondLevelCacheHitCount
public long getSecondLevelCacheHitCount()
- Specified by:
getSecondLevelCacheHitCountin interfaceorg.hibernate.stat.Statistics- Returns:
- second level cache hit
-
getSecondLevelCacheMissCount
public long getSecondLevelCacheMissCount()
- Specified by:
getSecondLevelCacheMissCountin interfaceorg.hibernate.stat.Statistics- Returns:
- second level cache miss
-
getSecondLevelCachePutCount
public long getSecondLevelCachePutCount()
- Specified by:
getSecondLevelCachePutCountin interfaceorg.hibernate.stat.Statistics- Returns:
- second level cache put
-
getSessionCloseCount
public long getSessionCloseCount()
- Specified by:
getSessionCloseCountin interfaceorg.hibernate.stat.Statistics- Returns:
- session closing
-
getSessionOpenCount
public long getSessionOpenCount()
- Specified by:
getSessionOpenCountin interfaceorg.hibernate.stat.Statistics- Returns:
- session opening
-
getCollectionLoadCount
public long getCollectionLoadCount()
- Specified by:
getCollectionLoadCountin interfaceorg.hibernate.stat.Statistics- Returns:
- collection loading (from DB)
-
getCollectionFetchCount
public long getCollectionFetchCount()
- Specified by:
getCollectionFetchCountin interfaceorg.hibernate.stat.Statistics- Returns:
- collection fetching (from DB)
-
getCollectionUpdateCount
public long getCollectionUpdateCount()
- Specified by:
getCollectionUpdateCountin interfaceorg.hibernate.stat.Statistics- Returns:
- collection update
-
getCollectionRemoveCount
public long getCollectionRemoveCount()
- Specified by:
getCollectionRemoveCountin interfaceorg.hibernate.stat.Statistics- Returns:
- collection removal FIXME: even if isInverse="true"?
-
getCollectionRecreateCount
public long getCollectionRecreateCount()
- Specified by:
getCollectionRecreateCountin interfaceorg.hibernate.stat.Statistics- Returns:
- collection recreation
-
getStartTime
public long getStartTime()
- Specified by:
getStartTimein interfaceorg.hibernate.stat.Statistics- Returns:
- start time in ms (JVM standards
System.currentTimeMillis())
-
logSummary
public void logSummary()
log in info level the main statistics- Specified by:
logSummaryin interfaceorg.hibernate.stat.Statistics
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
Are statistics logged- Specified by:
isStatisticsEnabledin interfaceorg.hibernate.stat.Statistics
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean b)
Enable statistics logs (this is a dynamic parameter)- Specified by:
setStatisticsEnabledin interfaceorg.hibernate.stat.Statistics
-
getQueryExecutionMaxTime
public long getQueryExecutionMaxTime()
- Specified by:
getQueryExecutionMaxTimein interfaceorg.hibernate.stat.Statistics- Returns:
- Returns the max query execution time, for all queries
-
getQueries
public java.lang.String[] getQueries()
Get all executed query strings- Specified by:
getQueriesin interfaceorg.hibernate.stat.Statistics
-
getEntityNames
public java.lang.String[] getEntityNames()
Get the names of all entities- Specified by:
getEntityNamesin interfaceorg.hibernate.stat.Statistics
-
getCollectionRoleNames
public java.lang.String[] getCollectionRoleNames()
Get the names of all collection roles- Specified by:
getCollectionRoleNamesin interfaceorg.hibernate.stat.Statistics
-
getSecondLevelCacheRegionNames
public java.lang.String[] getSecondLevelCacheRegionNames()
Get all second-level cache region names- Specified by:
getSecondLevelCacheRegionNamesin interfaceorg.hibernate.stat.Statistics
-
endTransaction
public void endTransaction(boolean success)
- Specified by:
endTransactionin interfaceorg.hibernate.stat.StatisticsImplementor
-
getSuccessfulTransactionCount
public long getSuccessfulTransactionCount()
- Specified by:
getSuccessfulTransactionCountin interfaceorg.hibernate.stat.Statistics
-
getTransactionCount
public long getTransactionCount()
- Specified by:
getTransactionCountin interfaceorg.hibernate.stat.Statistics
-
closeStatement
public void closeStatement()
- Specified by:
closeStatementin interfaceorg.hibernate.stat.StatisticsImplementor
-
prepareStatement
public void prepareStatement()
- Specified by:
prepareStatementin interfaceorg.hibernate.stat.StatisticsImplementor
-
getCloseStatementCount
public long getCloseStatementCount()
- Specified by:
getCloseStatementCountin interfaceorg.hibernate.stat.Statistics
-
getPrepareStatementCount
public long getPrepareStatementCount()
- Specified by:
getPrepareStatementCountin interfaceorg.hibernate.stat.Statistics
-
optimisticFailure
public void optimisticFailure(java.lang.String entityName)
- Specified by:
optimisticFailurein interfaceorg.hibernate.stat.StatisticsImplementor
-
getOptimisticFailureCount
public long getOptimisticFailureCount()
- Specified by:
getOptimisticFailureCountin interfaceorg.hibernate.stat.Statistics
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getQueryExecutionMaxTimeQueryString
public java.lang.String getQueryExecutionMaxTimeQueryString()
- Specified by:
getQueryExecutionMaxTimeQueryStringin interfaceorg.hibernate.stat.Statistics
-
-