Package org.hibernate.stat.spi
Interface StatisticsImplementor
- All Superinterfaces:
Serializable
,Service
,Statistics
- All Known Implementing Classes:
StatisticsImpl
A service SPI for collecting statistics about various events occurring at runtime.
A custom implementation may be provided via a StatisticsFactory
.
-
Field Summary
Fields inherited from interface org.hibernate.stat.Statistics
DEFAULT_QUERY_STATISTICS_MAX_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback about a session being closed.void
Callback about a statement being closed.void
collectionCacheHit
(NavigableRole collectionRole, String regionName) Callback indicating a get from second level cache resulted in a hit.void
collectionCacheMiss
(NavigableRole collectionRole, String regionName) Callback indicating a get from second level cache resulted in a miss.void
collectionCachePut
(NavigableRole collectionRole, String regionName) Callback indicating a put into second level cache.void
connect()
Callback about a connection being obtained fromConnectionProvider
void
deleteEntity
(String entityName) Callback about an entity being deleted.void
endTransaction
(boolean success) Callback about a transaction completing.void
entityCacheHit
(NavigableRole entityName, String regionName) Callback indicating a get from second level cache resulted in a hit.void
entityCacheMiss
(NavigableRole entityName, String regionName) Callback indicating a get from second level cache resulted in a miss.void
entityCachePut
(NavigableRole entityName, String regionName) Callback indicating a put into second level cache.void
fetchCollection
(String role) Callback to indicate a collection being fetched.void
fetchEntity
(String entityName) Callback about an entity being fetched.void
flush()
Callback about a flush occurringIf "hibernate.log_slow_query" is enabled, a map from the SQL query to the maximum execution time in milliseconds.void
insertEntity
(String entityName) Callback about an entity being insertedvoid
loadCollection
(String role) Callback about a collection loading.void
loadEntity
(String entityName) Callback about an entity being loaded.void
naturalIdCacheHit
(NavigableRole rootEntityName, String regionName) Callback indicating a get from natural id cache resulted in a hit.void
naturalIdCacheMiss
(NavigableRole rootEntityName, String regionName) Callback indicating a get from natural id cache resulted in a miss.void
naturalIdCachePut
(NavigableRole rootEntityName, String regionName) Callback indicating a put into natural id cache.void
naturalIdQueryExecuted
(String rootEntityName, long executionTime) Callback indicating execution of a natural id queryvoid
Callback about a session being opened.void
optimisticFailure
(String entityName) Callback about an optimistic lock failure on an entityvoid
Callback about a statement being prepared.void
queryCacheHit
(String hql, String regionName) Callback indicating a get from the query cache resulted in a hit.void
queryCacheMiss
(String hql, String regionName) Callback indicating a get from the query cache resulted in a miss.void
queryCachePut
(String hql, String regionName) Callback indicating a put into the query cache.default void
queryCompiled
(String hql, long microseconds) Callback indicating compilation of a sql/hql queryvoid
queryExecuted
(String hql, int rows, long time) Callback indicating execution of a sql/hql querydefault void
queryPlanCacheHit
(String query) Callback indicating a get from the query plan cache resulted in a hit.default void
queryPlanCacheMiss
(String query) Callback indicating a get from the query plan cache resulted in a miss.void
recreateCollection
(String role) Callback indicating a collection recreation (full deletion + full (re-)insertion).void
removeCollection
(String role) Callback indicating a collection removal.default void
Register the execution of a slow SQL query.void
updateCollection
(String role) Callback indicating a collection was updated.void
updateEntity
(String entityName) Callback about an entity being updated.void
Callback indicating a hit to the timestamp cachevoid
Callback indicating a miss to the timestamp cachevoid
Callback indicating a put to the timestamp cachevoid
upsertEntity
(String entityName) Callback about an entity being upserted.Methods inherited from interface org.hibernate.stat.Statistics
clear, getCacheRegionStatistics, getCloseStatementCount, getCollectionFetchCount, getCollectionLoadCount, getCollectionRecreateCount, getCollectionRemoveCount, getCollectionRoleNames, getCollectionStatistics, getCollectionUpdateCount, getConnectCount, getDomainDataRegionStatistics, getEntityDeleteCount, getEntityFetchCount, getEntityInsertCount, getEntityLoadCount, getEntityNames, getEntityStatistics, getEntityUpdateCount, getEntityUpsertCount, getFlushCount, getNaturalIdCacheHitCount, getNaturalIdCacheMissCount, getNaturalIdCachePutCount, getNaturalIdQueryExecutionCount, getNaturalIdQueryExecutionMaxTime, getNaturalIdQueryExecutionMaxTimeEntity, getNaturalIdQueryExecutionMaxTimeRegion, getNaturalIdStatistics, getOptimisticFailureCount, getPrepareStatementCount, getQueries, getQueryCacheHitCount, getQueryCacheMissCount, getQueryCachePutCount, getQueryExecutionCount, getQueryExecutionMaxTime, getQueryExecutionMaxTimeQueryString, getQueryPlanCacheHitCount, getQueryPlanCacheMissCount, getQueryRegionStatistics, getQueryStatistics, getSecondLevelCacheHitCount, getSecondLevelCacheMissCount, getSecondLevelCachePutCount, getSecondLevelCacheRegionNames, getSessionCloseCount, getSessionOpenCount, getStart, getStartTime, getSuccessfulTransactionCount, getTransactionCount, getUpdateTimestampsCacheHitCount, getUpdateTimestampsCacheMissCount, getUpdateTimestampsCachePutCount, isStatisticsEnabled, logSummary, setStatisticsEnabled
-
Method Details
-
openSession
void openSession()Callback about a session being opened. -
closeSession
void closeSession()Callback about a session being closed. -
flush
void flush()Callback about a flush occurring -
connect
void connect()Callback about a connection being obtained fromConnectionProvider
-
prepareStatement
void prepareStatement()Callback about a statement being prepared. -
closeStatement
void closeStatement()Callback about a statement being closed. -
endTransaction
void endTransaction(boolean success) Callback about a transaction completing.- Parameters:
success
- Was the transaction successful?
-
loadEntity
Callback about an entity being loaded. This might indicate a proxy or a fully initialized entity, but in either case it means without a separate SQL query being needed.- Parameters:
entityName
- The name of the entity loaded.
-
fetchEntity
Callback about an entity being fetched. UnlikeloadEntity(java.lang.String)
this indicates a separate query being performed.- Parameters:
entityName
- The name of the entity fetched.
-
updateEntity
Callback about an entity being updated.- Parameters:
entityName
- The name of the entity updated.
-
upsertEntity
Callback about an entity being upserted.- Parameters:
entityName
- The name of the entity upserted.
-
insertEntity
Callback about an entity being inserted- Parameters:
entityName
- The name of the entity inserted
-
deleteEntity
Callback about an entity being deleted.- Parameters:
entityName
- The name of the entity deleted.
-
optimisticFailure
Callback about an optimistic lock failure on an entity- Parameters:
entityName
- The name of the entity.
-
loadCollection
Callback about a collection loading. This might indicate a lazy collection or an initialized collection being created, but in either case it means without a separate SQL query being needed.- Parameters:
role
- The collection role.
-
fetchCollection
Callback to indicate a collection being fetched. UnlikeloadCollection(java.lang.String)
, this indicates a separate query was needed.- Parameters:
role
- The collection role.
-
updateCollection
Callback indicating a collection was updated.- Parameters:
role
- The collection role.
-
recreateCollection
Callback indicating a collection recreation (full deletion + full (re-)insertion).- Parameters:
role
- The collection role.
-
removeCollection
Callback indicating a collection removal.- Parameters:
role
- The collection role.
-
naturalIdQueryExecuted
Callback indicating execution of a natural id query -
queryCachePut
Callback indicating a put into the query cache.- Parameters:
hql
- The queryregionName
- The cache region
-
queryCacheHit
Callback indicating a get from the query cache resulted in a hit.- Parameters:
hql
- The queryregionName
- The name of the cache region
-
queryCacheMiss
Callback indicating a get from the query cache resulted in a miss.- Parameters:
hql
- The queryregionName
- The name of the cache region
-
queryExecuted
Callback indicating execution of a sql/hql query- Parameters:
hql
- The queryrows
- Number of rows returnedtime
- execution time
-
updateTimestampsCacheHit
void updateTimestampsCacheHit()Callback indicating a hit to the timestamp cache -
updateTimestampsCacheMiss
void updateTimestampsCacheMiss()Callback indicating a miss to the timestamp cache -
updateTimestampsCachePut
void updateTimestampsCachePut()Callback indicating a put to the timestamp cache -
queryPlanCacheHit
Callback indicating a get from the query plan cache resulted in a hit.- Parameters:
query
- The query
-
queryPlanCacheMiss
Callback indicating a get from the query plan cache resulted in a miss.- Parameters:
query
- The query
-
queryCompiled
Callback indicating compilation of a sql/hql query- Parameters:
hql
- The querymicroseconds
- execution time
-
slowQuery
Register the execution of a slow SQL query. -
getSlowQueries
Description copied from interface:Statistics
If "hibernate.log_slow_query" is enabled, a map from the SQL query to the maximum execution time in milliseconds.- Specified by:
getSlowQueries
in interfaceStatistics
- See Also:
-