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 Statisticspublic long getStartTime()
StatisticsSystem.currentTimeMillis()) from
which all statistics accessed since the initial creation of this Statistics
instance or the last Statistics.clear()getStartTime in interface Statisticspublic boolean isStatisticsEnabled()
StatisticsisStatisticsEnabled in interface Statisticspublic void setStatisticsEnabled(boolean b)
StatisticssetStatisticsEnabled in interface Statisticspublic String[] getEntityNames()
StatisticsgetEntityNames in interface Statisticspublic EntityStatisticsImpl getEntityStatistics(String entityName)
StatisticsgetEntityStatistics in interface StatisticsentityName - entity namepublic long getEntityLoadCount()
StatisticsgetEntityLoadCount in interface Statisticspublic long getEntityFetchCount()
StatisticsgetEntityFetchCount in interface Statisticspublic long getEntityDeleteCount()
StatisticsgetEntityDeleteCount in interface Statisticspublic long getEntityInsertCount()
StatisticsgetEntityInsertCount in interface Statisticspublic long getEntityUpdateCount()
StatisticsgetEntityUpdateCount in interface Statisticspublic long getOptimisticFailureCount()
StatisticsgetOptimisticFailureCount in interface Statisticspublic void loadEntity(String entityName)
StatisticsImplementorloadEntity in interface StatisticsImplementorentityName - The name of the entity loaded.public void fetchEntity(String entityName)
StatisticsImplementorStatisticsImplementor.loadEntity(java.lang.String) this indicates a separate query being
performed.fetchEntity in interface StatisticsImplementorentityName - The name of the entity fetched.public void updateEntity(String entityName)
StatisticsImplementorupdateEntity in interface StatisticsImplementorentityName - The name of the entity updated.public void insertEntity(String entityName)
StatisticsImplementorinsertEntity in interface StatisticsImplementorentityName - The name of the entity insertedpublic void deleteEntity(String entityName)
StatisticsImplementordeleteEntity in interface StatisticsImplementorentityName - The name of the entity deleted.public void optimisticFailure(String entityName)
StatisticsImplementoroptimisticFailure in interface StatisticsImplementorentityName - The name of the entity.public void entityCachePut(NavigableRole entityName, String regionName)
StatisticsImplementorentityCachePut in interface StatisticsImplementorpublic void entityCacheHit(NavigableRole entityName, String regionName)
StatisticsImplementorentityCacheHit in interface StatisticsImplementorpublic void entityCacheMiss(NavigableRole entityName, String regionName)
StatisticsImplementorentityCacheMiss in interface StatisticsImplementorpublic String[] getCollectionRoleNames()
StatisticsgetCollectionRoleNames in interface Statisticspublic CollectionStatisticsImpl getCollectionStatistics(String role)
StatisticsgetCollectionStatistics in interface Statisticsrole - collection rolepublic long getCollectionLoadCount()
StatisticsgetCollectionLoadCount in interface Statisticspublic long getCollectionFetchCount()
StatisticsgetCollectionFetchCount in interface Statisticspublic long getCollectionUpdateCount()
StatisticsgetCollectionUpdateCount in interface Statisticspublic long getCollectionRemoveCount()
StatisticsgetCollectionRemoveCount in interface Statisticspublic long getCollectionRecreateCount()
StatisticsgetCollectionRecreateCount in interface Statisticspublic void loadCollection(String role)
StatisticsImplementorloadCollection in interface StatisticsImplementorrole - The collection role.public void fetchCollection(String role)
StatisticsImplementorStatisticsImplementor.loadCollection(java.lang.String), this indicates a separate
query was needed.fetchCollection in interface StatisticsImplementorrole - The collection role.public void updateCollection(String role)
StatisticsImplementorupdateCollection in interface StatisticsImplementorrole - The collection role.public void recreateCollection(String role)
StatisticsImplementorrecreateCollection in interface StatisticsImplementorrole - The collection role.public void removeCollection(String role)
StatisticsImplementorremoveCollection in interface StatisticsImplementorrole - The collection role.public void collectionCachePut(NavigableRole collectionRole, String regionName)
StatisticsImplementorcollectionCachePut in interface StatisticsImplementorcollectionRole - The collection's "path"regionName - The name of the cache regionpublic void collectionCacheHit(NavigableRole collectionRole, String regionName)
StatisticsImplementorcollectionCacheHit in interface StatisticsImplementorcollectionRole - The collection's "path"regionName - The name of the cache regionpublic void collectionCacheMiss(NavigableRole collectionRole, String regionName)
StatisticsImplementorcollectionCacheMiss in interface StatisticsImplementorcollectionRole - The collection's "path"regionName - The name of the cache regionpublic NaturalIdStatisticsImpl getNaturalIdStatistics(String rootEntityName)
StatisticsgetNaturalIdStatistics in interface StatisticsrootEntityName - The entity name that is the root of the hierarchy containing the
natural idpublic DeprecatedNaturalIdCacheStatisticsImpl getNaturalIdCacheStatistics(String regionName)
StatisticsgetNaturalIdCacheStatistics in interface StatisticsregionName - region namepublic long getNaturalIdQueryExecutionCount()
StatisticsgetNaturalIdQueryExecutionCount in interface Statisticspublic long getNaturalIdQueryExecutionMaxTime()
StatisticsgetNaturalIdQueryExecutionMaxTime in interface Statisticspublic String getNaturalIdQueryExecutionMaxTimeRegion()
StatisticsgetNaturalIdQueryExecutionMaxTimeRegion in interface Statisticspublic String getNaturalIdQueryExecutionMaxTimeEntity()
getNaturalIdQueryExecutionMaxTimeEntity in interface Statisticspublic long getNaturalIdCacheHitCount()
StatisticsgetNaturalIdCacheHitCount in interface Statisticspublic long getNaturalIdCacheMissCount()
StatisticsgetNaturalIdCacheMissCount in interface Statisticspublic long getNaturalIdCachePutCount()
StatisticsgetNaturalIdCachePutCount in interface Statisticspublic void naturalIdCachePut(NavigableRole rootEntityName, String regionName)
StatisticsImplementornaturalIdCachePut in interface StatisticsImplementorpublic void naturalIdCacheHit(NavigableRole rootEntityName, String regionName)
StatisticsImplementornaturalIdCacheHit in interface StatisticsImplementorpublic void naturalIdCacheMiss(NavigableRole rootEntityName, String regionName)
StatisticsImplementornaturalIdCacheMiss in interface StatisticsImplementorpublic void naturalIdQueryExecuted(String rootEntityName, long time)
StatisticsImplementornaturalIdQueryExecuted in interface StatisticsImplementorpublic String[] getSecondLevelCacheRegionNames()
StatisticsgetSecondLevelCacheRegionNames in interface Statisticspublic CacheRegionStatisticsImpl getDomainDataRegionStatistics(String regionName)
StatisticsgetDomainDataRegionStatistics in interface StatisticsregionName - The unqualified region namenull if the second level cache is
not enabledpublic CacheRegionStatisticsImpl getQueryRegionStatistics(String regionName)
StatisticsgetQueryRegionStatistics in interface StatisticsregionName - 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)
StatisticsgetCacheRegionStatistics in interface StatisticsregionName - The unqualified region namenull if no such region existspublic CacheRegionStatisticsImpl getSecondLevelCacheStatistics(String regionName)
StatisticsgetSecondLevelCacheStatistics in interface StatisticsregionName - qualified region namenull if the second level cache is not enabledpublic long getSecondLevelCacheHitCount()
StatisticsgetSecondLevelCacheHitCount in interface Statisticspublic long getSecondLevelCacheMissCount()
StatisticsgetSecondLevelCacheMissCount in interface Statisticspublic long getSecondLevelCachePutCount()
StatisticsgetSecondLevelCachePutCount in interface Statisticspublic long getUpdateTimestampsCacheHitCount()
StatisticsgetUpdateTimestampsCacheHitCount in interface Statisticspublic long getUpdateTimestampsCacheMissCount()
StatisticsgetUpdateTimestampsCacheMissCount in interface Statisticspublic long getUpdateTimestampsCachePutCount()
StatisticsgetUpdateTimestampsCachePutCount in interface Statisticspublic void updateTimestampsCacheHit()
StatisticsImplementorupdateTimestampsCacheHit in interface StatisticsImplementorpublic void updateTimestampsCacheMiss()
StatisticsImplementorupdateTimestampsCacheMiss in interface StatisticsImplementorpublic void updateTimestampsCachePut()
StatisticsImplementorupdateTimestampsCachePut in interface StatisticsImplementorpublic String[] getQueries()
StatisticsgetQueries in interface Statisticspublic QueryStatisticsImpl getQueryStatistics(String queryString)
StatisticsgetQueryStatistics in interface StatisticsqueryString - query stringpublic long getQueryExecutionCount()
StatisticsgetQueryExecutionCount in interface Statisticspublic long getQueryCacheHitCount()
StatisticsgetQueryCacheHitCount in interface Statisticspublic long getQueryCacheMissCount()
StatisticsgetQueryCacheMissCount in interface Statisticspublic long getQueryCachePutCount()
StatisticsgetQueryCachePutCount in interface Statisticspublic String getQueryExecutionMaxTimeQueryString()
StatisticsgetQueryExecutionMaxTimeQueryString in interface Statisticspublic long getQueryExecutionMaxTime()
StatisticsgetQueryExecutionMaxTime in interface Statisticspublic void queryExecuted(String hql, int rows, long time)
StatisticsImplementorqueryExecuted in interface StatisticsImplementorhql - The queryrows - Number of rows returnedtime - execution timepublic void queryCacheHit(String hql, String regionName)
StatisticsImplementorqueryCacheHit in interface StatisticsImplementorhql - The queryregionName - The name of the cache regionpublic void queryCacheMiss(String hql, String regionName)
StatisticsImplementorqueryCacheMiss in interface StatisticsImplementorhql - The queryregionName - The name of the cache regionpublic void queryCachePut(String hql, String regionName)
StatisticsImplementorqueryCachePut in interface StatisticsImplementorhql - The queryregionName - The cache regionpublic long getSessionOpenCount()
StatisticsgetSessionOpenCount in interface Statisticspublic long getSessionCloseCount()
StatisticsgetSessionCloseCount in interface Statisticspublic long getFlushCount()
StatisticsgetFlushCount in interface Statisticspublic long getConnectCount()
StatisticsgetConnectCount in interface Statisticspublic long getSuccessfulTransactionCount()
StatisticsgetSuccessfulTransactionCount in interface Statisticspublic long getTransactionCount()
StatisticsgetTransactionCount in interface Statisticspublic long getCloseStatementCount()
StatisticsgetCloseStatementCount in interface Statisticspublic long getPrepareStatementCount()
StatisticsgetPrepareStatementCount in interface Statisticspublic void openSession()
StatisticsImplementoropenSession in interface StatisticsImplementorpublic void closeSession()
StatisticsImplementorcloseSession in interface StatisticsImplementorpublic void flush()
StatisticsImplementorflush in interface StatisticsImplementorpublic void connect()
StatisticsImplementorConnectionProviderconnect in interface StatisticsImplementorpublic void prepareStatement()
StatisticsImplementorprepareStatement in interface StatisticsImplementorpublic void closeStatement()
StatisticsImplementorcloseStatement in interface StatisticsImplementorpublic void endTransaction(boolean success)
StatisticsImplementorendTransaction in interface StatisticsImplementorsuccess - Was the transaction successful?public void logSummary()
StatisticslogSummary in interface StatisticsCopyright © 2019 JBoss by Red Hat. All rights reserved.