Top Description Fields Methods
org.hibernate.stat.spi

public Interface StatisticsImplementor

extends Statistics, Service
Known Direct Implementers
org.hibernate.stat.internal.StatisticsImpl
Imports
org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.service.Service, org.hibernate.stat.Statistics, java.util.Map

A service SPI for collecting statistics about various events that occur at runtime.
Author
Emmanuel Bernard

Field Summary

Inherited from org.hibernate.stat.Statistics:
DEFAULT_QUERY_STATISTICS_MAX_SIZE

Method Summary

Modifier and TypeMethod and Description
public void
closeSession()

Callback about a session being closed.

public void
closeStatement()

Callback about a statement being closed.

public void
collectionCacheHit(NavigableRole
The collection's "path"
collectionRole
,
String
The name of the cache region
regionName
)

Callback indicating a get from second level cache resulted in a hit.

public void
collectionCacheMiss(NavigableRole
The collection's "path"
collectionRole
,
String
The name of the cache region
regionName
)

Callback indicating a get from second level cache resulted in a miss.

public void
collectionCachePut(NavigableRole
The collection's "path"
collectionRole
,
String
The name of the cache region
regionName
)

Callback indicating a put into second level cache.

public void
connect()

Callback about a connection being obtained from org.hibernate.engine.jdbc.connections.spi.ConnectionProvider

public void
deleteEntity(String
The name of the entity deleted.
entityName
)

Callback about an entity being deleted.

public void
endTransaction(boolean
Was the transaction successful?
success
)

Callback about a transaction completing.

public void
entityCacheHit(NavigableRole entityName, String regionName)

Callback indicating a get from second level cache resulted in a hit.

public void
entityCacheMiss(NavigableRole entityName, String regionName)

Callback indicating a get from second level cache resulted in a miss.

public void
entityCachePut(NavigableRole entityName, String regionName)

Callback indicating a put into second level cache.

public void
fetchCollection(String
The collection role.
role
)

Callback to indicate a collection being fetched.

public void
fetchEntity(String
The name of the entity fetched.
entityName
)

Callback about an entity being fetched.

public void
flush()

Callback about a flush occurring

public default Map<String, Long>
getSlowQueries()

Implements org.hibernate.stat.Statistics.getSlowQueries.

If hibernate.log_slow_query is enabled, a map from the SQL query to the maximum execution time in milliseconds.
public void
insertEntity(String
The name of the entity inserted
entityName
)

Callback about an entity being inserted

public void
loadCollection(String
The collection role.
role
)

Callback about a collection loading.

public void
loadEntity(String
The name of the entity loaded.
entityName
)

Callback about an entity being loaded.

public void
naturalIdCacheHit(NavigableRole rootEntityName, String regionName)

Callback indicating a get from natural id cache resulted in a hit.

public void
naturalIdCacheMiss(NavigableRole rootEntityName, String regionName)

Callback indicating a get from natural id cache resulted in a miss.

public void
naturalIdCachePut(NavigableRole rootEntityName, String regionName)

Callback indicating a put into natural id cache.

public void
naturalIdQueryExecuted(String rootEntityName, long executionTime)

Callback indicating execution of a natural id query

public void
openSession()

Callback about a session being opened.

public void
optimisticFailure(String
The name of the entity.
entityName
)

Callback about an optimistic lock failure on an entity

public void
prepareStatement()

Callback about a statement being prepared.

public void
queryCacheHit(String
The query
hql
,
String
The name of the cache region
regionName
)

Callback indicating a get from the query cache resulted in a hit.

public void
queryCacheMiss(String
The query
hql
,
String
The name of the cache region
regionName
)

Callback indicating a get from the query cache resulted in a miss.

public void
queryCachePut(String
The query
hql
,
String
The cache region
regionName
)

Callback indicating a put into the query cache.

public default void
queryCompiled(String
The query
hql
,
long
execution time
microseconds
)

Callback indicating compilation of a sql/hql query

public void
queryExecuted(String
The query
hql
,
int
Number of rows returned
rows
,
long
execution time
time
)

Callback indicating execution of a sql/hql query

public default void
queryPlanCacheHit(String
The query
query
)

Callback indicating a get from the query plan cache resulted in a hit.

public default void
queryPlanCacheMiss(String
The query
query
)

Callback indicating a get from the query plan cache resulted in a miss.

public void
recreateCollection(String
The collection role.
role
)

Callback indicating a collection recreation (full deletion + full (re-)insertion).

public void
removeCollection(String
The collection role.
role
)

Callback indicating a collection removal.

public default void
slowQuery(String sql, long executionTime)

Register the execution of a slow SQL query.

public void
updateCollection(String
The collection role.
role
)

Callback indicating a collection was updated.

public void
updateEntity(String
The name of the entity updated.
entityName
)

Callback about an entity being updated.

public void
updateTimestampsCacheHit()

Callback indicating a hit to the timestamp cache

public void
updateTimestampsCacheMiss()

Callback indicating a miss to the timestamp cache

public void
updateTimestampsCachePut()

Callback indicating a put to the timestamp cache

Inherited from org.hibernate.stat.Statistics:
cleargetCacheRegionStatisticsgetCloseStatementCountgetCollectionFetchCountgetCollectionLoadCountgetCollectionRecreateCountgetCollectionRemoveCountgetCollectionRoleNamesgetCollectionStatisticsgetCollectionUpdateCountgetConnectCountgetDomainDataRegionStatisticsgetEntityDeleteCountgetEntityFetchCountgetEntityInsertCountgetEntityLoadCountgetEntityNamesgetEntityStatisticsgetEntityUpdateCountgetFlushCountgetNaturalIdCacheHitCountgetNaturalIdCacheMissCountgetNaturalIdCachePutCountgetNaturalIdQueryExecutionCountgetNaturalIdQueryExecutionMaxTimegetNaturalIdQueryExecutionMaxTimeEntitygetNaturalIdQueryExecutionMaxTimeRegiongetNaturalIdStatisticsgetOptimisticFailureCountgetPrepareStatementCountgetQueriesgetQueryCacheHitCountgetQueryCacheMissCountgetQueryCachePutCountgetQueryExecutionCountgetQueryExecutionMaxTimegetQueryExecutionMaxTimeQueryStringgetQueryPlanCacheHitCountgetQueryPlanCacheMissCountgetQueryRegionStatisticsgetQueryStatisticsgetSecondLevelCacheHitCountgetSecondLevelCacheMissCountgetSecondLevelCachePutCountgetSecondLevelCacheRegionNamesgetSessionCloseCountgetSessionOpenCountgetStartgetStartTimegetSuccessfulTransactionCountgetTransactionCountgetUpdateTimestampsCacheHitCountgetUpdateTimestampsCacheMissCountgetUpdateTimestampsCachePutCountisStatisticsEnabledlogSummarysetStatisticsEnabled

Method Detail

closeSessionback to summary
public void closeSession()

Callback about a session being closed.

closeStatementback to summary
public void closeStatement()

Callback about a statement being closed.

collectionCacheHitback to summary
public void collectionCacheHit(NavigableRole collectionRole, String regionName)

Callback indicating a get from second level cache resulted in a hit.

Parameters
collectionRole:NavigableRole

The collection's "path"

regionName:String

The name of the cache region

collectionCacheMissback to summary
public void collectionCacheMiss(NavigableRole collectionRole, String regionName)

Callback indicating a get from second level cache resulted in a miss.

Parameters
collectionRole:NavigableRole

The collection's "path"

regionName:String

The name of the cache region

collectionCachePutback to summary
public void collectionCachePut(NavigableRole collectionRole, String regionName)

Callback indicating a put into second level cache.

Parameters
collectionRole:NavigableRole

The collection's "path"

regionName:String

The name of the cache region

connectback to summary
public void connect()

Callback about a connection being obtained from org.hibernate.engine.jdbc.connections.spi.ConnectionProvider

deleteEntityback to summary
public void deleteEntity(String entityName)

Callback about an entity being deleted.

Parameters
entityName:String

The name of the entity deleted.

endTransactionback to summary
public void endTransaction(boolean success)

Callback about a transaction completing.

Parameters
success:boolean

Was the transaction successful?

entityCacheHitback to summary
public void entityCacheHit(NavigableRole entityName, String regionName)

Callback indicating a get from second level cache resulted in a hit.

API Note

`entityName` should be the root entity name

entityCacheMissback to summary
public void entityCacheMiss(NavigableRole entityName, String regionName)

Callback indicating a get from second level cache resulted in a miss.

API Note

`entityName` should be the root entity name

entityCachePutback to summary
public void entityCachePut(NavigableRole entityName, String regionName)

Callback indicating a put into second level cache.

API Note

`entityName` should be the root entity name

fetchCollectionback to summary
public void fetchCollection(String role)

Callback to indicate a collection being fetched. Unlike loadCollection, this indicates a separate query was needed.

Parameters
role:String

The collection role.

fetchEntityback to summary
public void fetchEntity(String entityName)

Callback about an entity being fetched. Unlike loadEntity this indicates a separate query being performed.

Parameters
entityName:String

The name of the entity fetched.

flushback to summary
public void flush()

Callback about a flush occurring

getSlowQueriesback to summary
public default Map<String, Long> getSlowQueries()

Implements org.hibernate.stat.Statistics.getSlowQueries.

Doc from org.hibernate.stat.Statistics.getSlowQueries.

If hibernate.log_slow_query is enabled, a map from the SQL query to the maximum execution time in milliseconds.

Annotations
@Override
insertEntityback to summary
public void insertEntity(String entityName)

Callback about an entity being inserted

Parameters
entityName:String

The name of the entity inserted

loadCollectionback to summary
public void loadCollection(String role)

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:String

The collection role.

loadEntityback to summary
public void loadEntity(String entityName)

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:String

The name of the entity loaded.

naturalIdCacheHitback to summary
public void naturalIdCacheHit(NavigableRole rootEntityName, String regionName)

Callback indicating a get from natural id cache resulted in a hit.

naturalIdCacheMissback to summary
public void naturalIdCacheMiss(NavigableRole rootEntityName, String regionName)

Callback indicating a get from natural id cache resulted in a miss.

naturalIdCachePutback to summary
public void naturalIdCachePut(NavigableRole rootEntityName, String regionName)

Callback indicating a put into natural id cache.

naturalIdQueryExecutedback to summary
public void naturalIdQueryExecuted(String rootEntityName, long executionTime)

Callback indicating execution of a natural id query

openSessionback to summary
public void openSession()

Callback about a session being opened.

optimisticFailureback to summary
public void optimisticFailure(String entityName)

Callback about an optimistic lock failure on an entity

Parameters
entityName:String

The name of the entity.

prepareStatementback to summary
public void prepareStatement()

Callback about a statement being prepared.

queryCacheHitback to summary
public void queryCacheHit(String hql, String regionName)

Callback indicating a get from the query cache resulted in a hit.

Parameters
hql:String

The query

regionName:String

The name of the cache region

queryCacheMissback to summary
public void queryCacheMiss(String hql, String regionName)

Callback indicating a get from the query cache resulted in a miss.

Parameters
hql:String

The query

regionName:String

The name of the cache region

queryCachePutback to summary
public void queryCachePut(String hql, String regionName)

Callback indicating a put into the query cache.

Parameters
hql:String

The query

regionName:String

The cache region

queryCompiledback to summary
public default void queryCompiled(String hql, long microseconds)

Callback indicating compilation of a sql/hql query

Parameters
hql:String

The query

microseconds:long

execution time

queryExecutedback to summary
public void queryExecuted(String hql, int rows, long time)

Callback indicating execution of a sql/hql query

Parameters
hql:String

The query

rows:int

Number of rows returned

time:long

execution time

queryPlanCacheHitback to summary
public default void queryPlanCacheHit(String query)

Callback indicating a get from the query plan cache resulted in a hit.

Parameters
query:String

The query

queryPlanCacheMissback to summary
public default void queryPlanCacheMiss(String query)

Callback indicating a get from the query plan cache resulted in a miss.

Parameters
query:String

The query

recreateCollectionback to summary
public void recreateCollection(String role)

Callback indicating a collection recreation (full deletion + full (re-)insertion).

Parameters
role:String

The collection role.

removeCollectionback to summary
public void removeCollection(String role)

Callback indicating a collection removal.

Parameters
role:String

The collection role.

slowQueryback to summary
public default void slowQuery(String sql, long executionTime)

Register the execution of a slow SQL query.

updateCollectionback to summary
public void updateCollection(String role)

Callback indicating a collection was updated.

Parameters
role:String

The collection role.

updateEntityback to summary
public void updateEntity(String entityName)

Callback about an entity being updated.

Parameters
entityName:String

The name of the entity updated.

updateTimestampsCacheHitback to summary
public void updateTimestampsCacheHit()

Callback indicating a hit to the timestamp cache

updateTimestampsCacheMissback to summary
public void updateTimestampsCacheMiss()

Callback indicating a miss to the timestamp cache

updateTimestampsCachePutback to summary
public void updateTimestampsCachePut()

Callback indicating a put to the timestamp cache