public class StatisticsImpl extends Object implements StatisticsImplementor, Service
Statistics
based on the java.util.concurrent
package.Constructor and Description |
---|
StatisticsImpl() |
StatisticsImpl(SessionFactoryImplementor sessionFactory) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
reset all statistics
|
void |
closeSession()
Callback about a session being closed.
|
void |
closeStatement()
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 from
ConnectionProvider |
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 occurring
|
CacheRegionStatisticsImpl |
getCacheRegionStatistics(String regionName)
Get statistics for either a domain-data or query-result region - this
method checks both, preferring domain data region if one.
|
long |
getCloseStatementCount()
The number of prepared statements that were released
|
long |
getCollectionFetchCount()
Global number of collections fetched
|
long |
getCollectionLoadCount()
Global number of collections loaded
|
long |
getCollectionRecreateCount()
Global number of collections recreated
|
long |
getCollectionRemoveCount()
Global number of collections removed
|
String[] |
getCollectionRoleNames()
Get the names of all collection roles
|
CollectionStatisticsImpl |
getCollectionStatistics(String role)
Get collection statistics per role
|
long |
getCollectionUpdateCount()
Global number of collections updated
|
long |
getConnectCount()
Get the global number of connections asked by the sessions
(the actual number of connections used may be much smaller depending
whether you use a connection pool or not)
|
CacheRegionStatisticsImpl |
getDomainDataRegionStatistics(String regionName)
Second level cache statistics per domain data (entity, collection, natural-id) region
|
long |
getEntityDeleteCount()
Get global number of entity deletes
|
long |
getEntityFetchCount()
Get global number of entity fetchs
|
long |
getEntityInsertCount()
Get global number of entity inserts
|
long |
getEntityLoadCount()
Get global number of entity loads
|
String[] |
getEntityNames()
Get the names of all entities
|
EntityStatisticsImpl |
getEntityStatistics(String entityName)
find entity statistics per name
|
long |
getEntityUpdateCount()
Get global number of entity updates
|
long |
getFlushCount()
Get the global number of flush executed by sessions (either implicit or explicit)
|
long |
getNaturalIdCacheHitCount()
Get the global number of cached naturalId lookups successfully retrieved from cache
|
long |
getNaturalIdCacheMissCount()
Get the global number of cached naturalId lookups *not* found in cache
|
long |
getNaturalIdCachePutCount()
Get the global number of cacheable naturalId lookups put in cache
|
DeprecatedNaturalIdCacheStatisticsImpl |
getNaturalIdCacheStatistics(String regionName)
Natural id cache statistics per region
|
long |
getNaturalIdQueryExecutionCount()
Get the global number of naturalId queries executed against the database
|
long |
getNaturalIdQueryExecutionMaxTime()
Get the global maximum query time for naturalId queries executed against the database
|
String |
getNaturalIdQueryExecutionMaxTimeEntity() |
String |
getNaturalIdQueryExecutionMaxTimeRegion()
Get the region for the maximum naturalId query time
|
NaturalIdStatisticsImpl |
getNaturalIdStatistics(String rootEntityName)
Natural id resolution query statistics for an entity type
|
long |
getOptimisticFailureCount()
The number of StaleObjectStateExceptions
that occurred
|
long |
getPrepareStatementCount()
The number of prepared statements that were acquired
|
String[] |
getQueries()
Get all executed query strings
|
long |
getQueryCacheHitCount()
Get the global number of cached queries successfully retrieved from cache
|
long |
getQueryCacheMissCount()
Get the global number of cached queries *not* found in cache
|
long |
getQueryCachePutCount()
Get the global number of cacheable queries put in cache
|
long |
getQueryExecutionCount()
Get global number of executed queries
|
long |
getQueryExecutionMaxTime()
Get the time in milliseconds of the slowest query.
|
String |
getQueryExecutionMaxTimeQueryString()
Get the query string for the slowest query.
|
CacheRegionStatisticsImpl |
getQueryRegionStatistics(String regionName)
Second level cache statistics per query region
|
QueryStatisticsImpl |
getQueryStatistics(String queryString)
Query statistics from query string (HQL or SQL)
|
long |
getSecondLevelCacheHitCount()
Global number of cacheable entities/collections successfully retrieved from the cache
|
long |
getSecondLevelCacheMissCount()
Global number of cacheable entities/collections not found in the cache and loaded from the database.
|
long |
getSecondLevelCachePutCount()
Global number of cacheable entities/collections put in the cache
|
String[] |
getSecondLevelCacheRegionNames()
Get all second-level cache region names.
|
CacheRegionStatisticsImpl |
getSecondLevelCacheStatistics(String regionName)
Second level cache statistics per region
|
long |
getSessionCloseCount()
Global number of sessions closed
|
long |
getSessionOpenCount()
Global number of sessions opened
|
long |
getStartTime()
The milliseconds (JVM standard
System.currentTimeMillis() ) from
which all statistics accessed since the initial creation of this Statistics
instance or the last Statistics.clear() |
long |
getSuccessfulTransactionCount()
The number of transactions we know to have been successful
|
long |
getTransactionCount()
The number of transactions we know to have completed
|
long |
getUpdateTimestampsCacheHitCount()
Get the global number of timestamps successfully retrieved from cache
|
long |
getUpdateTimestampsCacheMissCount()
Get the global number of tables for which no update timestamps was *not* found in cache
|
long |
getUpdateTimestampsCachePutCount()
Get the global number of timestamps put in cache
|
void |
insertEntity(String entityName)
Callback about an entity being inserted
|
boolean |
isStatisticsEnabled()
Are statistics enabled
|
void |
loadCollection(String role)
Callback about a collection loading.
|
void |
loadEntity(String entityName)
Callback about an entity being loaded.
|
void |
logSummary()
log in info level the main statistics
|
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 time)
Callback indicating execution of a natural id query
|
void |
openSession()
Callback about a session being opened.
|
void |
optimisticFailure(String entityName)
Callback about an optimistic lock failure on an entity
|
void |
prepareStatement()
Callback about a statement being prepared.
|
protected String |
qualify(String regionName) |
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.
|
void |
queryExecuted(String hql,
int rows,
long time)
Callback indicating execution of a sql/hql query
|
void |
recreateCollection(String role)
Callback indicating a collection recreation (full deletion + full (re-)insertion).
|
void |
removeCollection(String role)
Callback indicating a collection removal.
|
void |
setStatisticsEnabled(boolean b)
Enable statistics logs (this is a dynamic parameter)
|
String |
toString() |
void |
updateCollection(String role)
Callback indicating a collection was updated.
|
void |
updateEntity(String entityName)
Callback about an entity being updated.
|
void |
updateTimestampsCacheHit()
Callback indicating a hit to the timestamp cache
|
void |
updateTimestampsCacheMiss()
Callback indicating a miss to the timestamp cache
|
void |
updateTimestampsCachePut()
Callback indicating a put to the timestamp cache
|
public StatisticsImpl()
public StatisticsImpl(SessionFactoryImplementor sessionFactory)
public void clear()
clear
in interface Statistics
public long getStartTime()
Statistics
System.currentTimeMillis()
) from
which all statistics accessed since the initial creation of this Statistics
instance or the last Statistics.clear()
getStartTime
in interface Statistics
public boolean isStatisticsEnabled()
Statistics
isStatisticsEnabled
in interface Statistics
public void setStatisticsEnabled(boolean b)
Statistics
setStatisticsEnabled
in interface Statistics
public String[] getEntityNames()
Statistics
getEntityNames
in interface Statistics
public EntityStatisticsImpl getEntityStatistics(String entityName)
Statistics
getEntityStatistics
in interface Statistics
entityName
- entity namepublic long getEntityLoadCount()
Statistics
getEntityLoadCount
in interface Statistics
public long getEntityFetchCount()
Statistics
getEntityFetchCount
in interface Statistics
public long getEntityDeleteCount()
Statistics
getEntityDeleteCount
in interface Statistics
public long getEntityInsertCount()
Statistics
getEntityInsertCount
in interface Statistics
public long getEntityUpdateCount()
Statistics
getEntityUpdateCount
in interface Statistics
public long getOptimisticFailureCount()
Statistics
getOptimisticFailureCount
in interface Statistics
public void loadEntity(String entityName)
StatisticsImplementor
loadEntity
in interface StatisticsImplementor
entityName
- The name of the entity loaded.public void fetchEntity(String entityName)
StatisticsImplementor
StatisticsImplementor.loadEntity(java.lang.String)
this indicates a separate query being
performed.fetchEntity
in interface StatisticsImplementor
entityName
- The name of the entity fetched.public void updateEntity(String entityName)
StatisticsImplementor
updateEntity
in interface StatisticsImplementor
entityName
- The name of the entity updated.public void insertEntity(String entityName)
StatisticsImplementor
insertEntity
in interface StatisticsImplementor
entityName
- The name of the entity insertedpublic void deleteEntity(String entityName)
StatisticsImplementor
deleteEntity
in interface StatisticsImplementor
entityName
- The name of the entity deleted.public void optimisticFailure(String entityName)
StatisticsImplementor
optimisticFailure
in interface StatisticsImplementor
entityName
- The name of the entity.public void entityCachePut(NavigableRole entityName, String regionName)
StatisticsImplementor
entityCachePut
in interface StatisticsImplementor
public void entityCacheHit(NavigableRole entityName, String regionName)
StatisticsImplementor
entityCacheHit
in interface StatisticsImplementor
public void entityCacheMiss(NavigableRole entityName, String regionName)
StatisticsImplementor
entityCacheMiss
in interface StatisticsImplementor
public String[] getCollectionRoleNames()
Statistics
getCollectionRoleNames
in interface Statistics
public CollectionStatisticsImpl getCollectionStatistics(String role)
Statistics
getCollectionStatistics
in interface Statistics
role
- collection rolepublic long getCollectionLoadCount()
Statistics
getCollectionLoadCount
in interface Statistics
public long getCollectionFetchCount()
Statistics
getCollectionFetchCount
in interface Statistics
public long getCollectionUpdateCount()
Statistics
getCollectionUpdateCount
in interface Statistics
public long getCollectionRemoveCount()
Statistics
getCollectionRemoveCount
in interface Statistics
public long getCollectionRecreateCount()
Statistics
getCollectionRecreateCount
in interface Statistics
public void loadCollection(String role)
StatisticsImplementor
loadCollection
in interface StatisticsImplementor
role
- The collection role.public void fetchCollection(String role)
StatisticsImplementor
StatisticsImplementor.loadCollection(java.lang.String)
, this indicates a separate
query was needed.fetchCollection
in interface StatisticsImplementor
role
- The collection role.public void updateCollection(String role)
StatisticsImplementor
updateCollection
in interface StatisticsImplementor
role
- The collection role.public void recreateCollection(String role)
StatisticsImplementor
recreateCollection
in interface StatisticsImplementor
role
- The collection role.public void removeCollection(String role)
StatisticsImplementor
removeCollection
in interface StatisticsImplementor
role
- The collection role.public void collectionCachePut(NavigableRole collectionRole, String regionName)
StatisticsImplementor
collectionCachePut
in interface StatisticsImplementor
collectionRole
- The collection's "path"regionName
- The name of the cache regionpublic void collectionCacheHit(NavigableRole collectionRole, String regionName)
StatisticsImplementor
collectionCacheHit
in interface StatisticsImplementor
collectionRole
- The collection's "path"regionName
- The name of the cache regionpublic void collectionCacheMiss(NavigableRole collectionRole, String regionName)
StatisticsImplementor
collectionCacheMiss
in interface StatisticsImplementor
collectionRole
- The collection's "path"regionName
- The name of the cache regionpublic NaturalIdStatisticsImpl getNaturalIdStatistics(String rootEntityName)
Statistics
getNaturalIdStatistics
in interface Statistics
rootEntityName
- The entity name that is the root of the hierarchy containing the
natural idpublic DeprecatedNaturalIdCacheStatisticsImpl getNaturalIdCacheStatistics(String regionName)
Statistics
getNaturalIdCacheStatistics
in interface Statistics
regionName
- region namepublic long getNaturalIdQueryExecutionCount()
Statistics
getNaturalIdQueryExecutionCount
in interface Statistics
public long getNaturalIdQueryExecutionMaxTime()
Statistics
getNaturalIdQueryExecutionMaxTime
in interface Statistics
public String getNaturalIdQueryExecutionMaxTimeRegion()
Statistics
getNaturalIdQueryExecutionMaxTimeRegion
in interface Statistics
public String getNaturalIdQueryExecutionMaxTimeEntity()
getNaturalIdQueryExecutionMaxTimeEntity
in interface Statistics
public long getNaturalIdCacheHitCount()
Statistics
getNaturalIdCacheHitCount
in interface Statistics
public long getNaturalIdCacheMissCount()
Statistics
getNaturalIdCacheMissCount
in interface Statistics
public long getNaturalIdCachePutCount()
Statistics
getNaturalIdCachePutCount
in interface Statistics
public void naturalIdCachePut(NavigableRole rootEntityName, String regionName)
StatisticsImplementor
naturalIdCachePut
in interface StatisticsImplementor
public void naturalIdCacheHit(NavigableRole rootEntityName, String regionName)
StatisticsImplementor
naturalIdCacheHit
in interface StatisticsImplementor
public void naturalIdCacheMiss(NavigableRole rootEntityName, String regionName)
StatisticsImplementor
naturalIdCacheMiss
in interface StatisticsImplementor
public void naturalIdQueryExecuted(String rootEntityName, long time)
StatisticsImplementor
naturalIdQueryExecuted
in interface StatisticsImplementor
public String[] getSecondLevelCacheRegionNames()
Statistics
getSecondLevelCacheRegionNames
in interface Statistics
public CacheRegionStatisticsImpl getDomainDataRegionStatistics(String regionName)
Statistics
getDomainDataRegionStatistics
in interface Statistics
regionName
- The unqualified region namenull
if the second level cache is
not enabledpublic CacheRegionStatisticsImpl getQueryRegionStatistics(String regionName)
Statistics
getQueryRegionStatistics
in interface Statistics
regionName
- The unqualified region namenull
if (1) query result caching is
not enabled or (2) no query region exists with that namepublic CacheRegionStatisticsImpl getCacheRegionStatistics(String regionName)
Statistics
getCacheRegionStatistics
in interface Statistics
regionName
- The unqualified region namenull
if no such region existspublic CacheRegionStatisticsImpl getSecondLevelCacheStatistics(String regionName)
Statistics
getSecondLevelCacheStatistics
in interface Statistics
regionName
- qualified region namenull
if the second level cache is not enabledpublic long getSecondLevelCacheHitCount()
Statistics
getSecondLevelCacheHitCount
in interface Statistics
public long getSecondLevelCacheMissCount()
Statistics
getSecondLevelCacheMissCount
in interface Statistics
public long getSecondLevelCachePutCount()
Statistics
getSecondLevelCachePutCount
in interface Statistics
public long getUpdateTimestampsCacheHitCount()
Statistics
getUpdateTimestampsCacheHitCount
in interface Statistics
public long getUpdateTimestampsCacheMissCount()
Statistics
getUpdateTimestampsCacheMissCount
in interface Statistics
public long getUpdateTimestampsCachePutCount()
Statistics
getUpdateTimestampsCachePutCount
in interface Statistics
public void updateTimestampsCacheHit()
StatisticsImplementor
updateTimestampsCacheHit
in interface StatisticsImplementor
public void updateTimestampsCacheMiss()
StatisticsImplementor
updateTimestampsCacheMiss
in interface StatisticsImplementor
public void updateTimestampsCachePut()
StatisticsImplementor
updateTimestampsCachePut
in interface StatisticsImplementor
public String[] getQueries()
Statistics
getQueries
in interface Statistics
public QueryStatisticsImpl getQueryStatistics(String queryString)
Statistics
getQueryStatistics
in interface Statistics
queryString
- query stringpublic long getQueryExecutionCount()
Statistics
getQueryExecutionCount
in interface Statistics
public long getQueryCacheHitCount()
Statistics
getQueryCacheHitCount
in interface Statistics
public long getQueryCacheMissCount()
Statistics
getQueryCacheMissCount
in interface Statistics
public long getQueryCachePutCount()
Statistics
getQueryCachePutCount
in interface Statistics
public String getQueryExecutionMaxTimeQueryString()
Statistics
getQueryExecutionMaxTimeQueryString
in interface Statistics
public long getQueryExecutionMaxTime()
Statistics
getQueryExecutionMaxTime
in interface Statistics
public void queryExecuted(String hql, int rows, long time)
StatisticsImplementor
queryExecuted
in interface StatisticsImplementor
hql
- The queryrows
- Number of rows returnedtime
- execution timepublic void queryCacheHit(String hql, String regionName)
StatisticsImplementor
queryCacheHit
in interface StatisticsImplementor
hql
- The queryregionName
- The name of the cache regionpublic void queryCacheMiss(String hql, String regionName)
StatisticsImplementor
queryCacheMiss
in interface StatisticsImplementor
hql
- The queryregionName
- The name of the cache regionpublic void queryCachePut(String hql, String regionName)
StatisticsImplementor
queryCachePut
in interface StatisticsImplementor
hql
- The queryregionName
- The cache regionpublic long getSessionOpenCount()
Statistics
getSessionOpenCount
in interface Statistics
public long getSessionCloseCount()
Statistics
getSessionCloseCount
in interface Statistics
public long getFlushCount()
Statistics
getFlushCount
in interface Statistics
public long getConnectCount()
Statistics
getConnectCount
in interface Statistics
public long getSuccessfulTransactionCount()
Statistics
getSuccessfulTransactionCount
in interface Statistics
public long getTransactionCount()
Statistics
getTransactionCount
in interface Statistics
public long getCloseStatementCount()
Statistics
getCloseStatementCount
in interface Statistics
public long getPrepareStatementCount()
Statistics
getPrepareStatementCount
in interface Statistics
public void openSession()
StatisticsImplementor
openSession
in interface StatisticsImplementor
public void closeSession()
StatisticsImplementor
closeSession
in interface StatisticsImplementor
public void flush()
StatisticsImplementor
flush
in interface StatisticsImplementor
public void connect()
StatisticsImplementor
ConnectionProvider
connect
in interface StatisticsImplementor
public void prepareStatement()
StatisticsImplementor
prepareStatement
in interface StatisticsImplementor
public void closeStatement()
StatisticsImplementor
closeStatement
in interface StatisticsImplementor
public void endTransaction(boolean success)
StatisticsImplementor
endTransaction
in interface StatisticsImplementor
success
- Was the transaction successful?public void logSummary()
Statistics
logSummary
in interface Statistics
Copyright © 2019 JBoss by Red Hat. All rights reserved.