public class ConcurrentStatisticsImpl extends Object implements StatisticsImplementor, Service
Statistics
based on the java.util.concurrent
package.Constructor and Description |
---|
ConcurrentStatisticsImpl() |
ConcurrentStatisticsImpl(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 |
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 |
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
|
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
|
CollectionStatistics |
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)
|
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
|
EntityStatistics |
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
|
NaturalIdCacheStatistics |
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 |
getNaturalIdQueryExecutionMaxTimeRegion()
Get the region for the maximum naturalId query time
|
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.
|
QueryStatistics |
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
|
SecondLevelCacheStatistics |
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() |
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 logged
|
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(String regionName)
Callback indicating a get from natural id cache resulted in a hit.
|
void |
naturalIdCacheMiss(String regionName)
Callback indicating a get from natural id cache resulted in a miss.
|
void |
naturalIdCachePut(String regionName)
Callback indicating a put into natural id cache.
|
void |
naturalIdQueryExecuted(String regionName,
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.
|
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 |
secondLevelCacheHit(String regionName)
Callback indicating a get from second level cache resulted in a hit.
|
void |
secondLevelCacheMiss(String regionName)
Callback indicating a get from second level cache resulted in a miss.
|
void |
secondLevelCachePut(String regionName)
Callback indicating a put into second level cache.
|
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 ConcurrentStatisticsImpl()
public ConcurrentStatisticsImpl(SessionFactoryImplementor sessionFactory)
public void clear()
clear
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 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 EntityStatistics getEntityStatistics(String entityName)
getEntityStatistics
in interface Statistics
entityName
- entity namepublic 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 CollectionStatistics getCollectionStatistics(String role)
getCollectionStatistics
in interface Statistics
role
- collection rolepublic 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 NaturalIdCacheStatistics getNaturalIdCacheStatistics(String regionName)
Statistics
getNaturalIdCacheStatistics
in interface Statistics
regionName
- region namepublic SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName)
getSecondLevelCacheStatistics
in interface Statistics
regionName
- region namepublic void secondLevelCachePut(String regionName)
StatisticsImplementor
secondLevelCachePut
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void secondLevelCacheHit(String regionName)
StatisticsImplementor
secondLevelCacheHit
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void secondLevelCacheMiss(String regionName)
StatisticsImplementor
secondLevelCacheMiss
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void naturalIdCachePut(String regionName)
StatisticsImplementor
naturalIdCachePut
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void naturalIdCacheHit(String regionName)
StatisticsImplementor
naturalIdCacheHit
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void naturalIdCacheMiss(String regionName)
StatisticsImplementor
naturalIdCacheMiss
in interface StatisticsImplementor
regionName
- The name of the cache regionpublic void naturalIdQueryExecuted(String regionName, long time)
StatisticsImplementor
naturalIdQueryExecuted
in interface StatisticsImplementor
regionName
- The name of the cache regiontime
- execution timepublic 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 void updateTimestampsCacheHit()
StatisticsImplementor
updateTimestampsCacheHit
in interface StatisticsImplementor
public void updateTimestampsCacheMiss()
StatisticsImplementor
updateTimestampsCacheMiss
in interface StatisticsImplementor
public void updateTimestampsCachePut()
StatisticsImplementor
updateTimestampsCachePut
in interface StatisticsImplementor
public QueryStatistics getQueryStatistics(String queryString)
getQueryStatistics
in interface Statistics
queryString
- query stringpublic long getEntityDeleteCount()
Statistics
getEntityDeleteCount
in interface Statistics
public long getEntityInsertCount()
Statistics
getEntityInsertCount
in interface Statistics
public long getEntityLoadCount()
Statistics
getEntityLoadCount
in interface Statistics
public long getEntityFetchCount()
Statistics
getEntityFetchCount
in interface Statistics
public long getEntityUpdateCount()
Statistics
getEntityUpdateCount
in interface Statistics
public 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 long getUpdateTimestampsCacheHitCount()
Statistics
getUpdateTimestampsCacheHitCount
in interface Statistics
public long getUpdateTimestampsCacheMissCount()
Statistics
getUpdateTimestampsCacheMissCount
in interface Statistics
public long getUpdateTimestampsCachePutCount()
Statistics
getUpdateTimestampsCachePutCount
in interface Statistics
public long getFlushCount()
Statistics
getFlushCount
in interface Statistics
public long getConnectCount()
Statistics
getConnectCount
in interface Statistics
public 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 getNaturalIdQueryExecutionCount()
Statistics
getNaturalIdQueryExecutionCount
in interface Statistics
public long getNaturalIdQueryExecutionMaxTime()
Statistics
getNaturalIdQueryExecutionMaxTime
in interface Statistics
public String getNaturalIdQueryExecutionMaxTimeRegion()
Statistics
getNaturalIdQueryExecutionMaxTimeRegion
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 long getSessionCloseCount()
Statistics
getSessionCloseCount
in interface Statistics
public long getSessionOpenCount()
Statistics
getSessionOpenCount
in interface Statistics
public 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 long getStartTime()
getStartTime
in interface Statistics
System.currentTimeMillis()
)public void logSummary()
logSummary
in interface Statistics
public boolean isStatisticsEnabled()
isStatisticsEnabled
in interface Statistics
public void setStatisticsEnabled(boolean b)
setStatisticsEnabled
in interface Statistics
public long getQueryExecutionMaxTime()
Statistics
getQueryExecutionMaxTime
in interface Statistics
public String[] getQueries()
getQueries
in interface Statistics
public String[] getEntityNames()
getEntityNames
in interface Statistics
public String[] getCollectionRoleNames()
getCollectionRoleNames
in interface Statistics
public String[] getSecondLevelCacheRegionNames()
getSecondLevelCacheRegionNames
in interface Statistics
public void endTransaction(boolean success)
StatisticsImplementor
endTransaction
in interface StatisticsImplementor
success
- Was the transaction successful?public long getSuccessfulTransactionCount()
Statistics
getSuccessfulTransactionCount
in interface Statistics
public long getTransactionCount()
Statistics
getTransactionCount
in interface Statistics
public void closeStatement()
StatisticsImplementor
closeStatement
in interface StatisticsImplementor
public void prepareStatement()
StatisticsImplementor
prepareStatement
in interface StatisticsImplementor
public long getCloseStatementCount()
Statistics
getCloseStatementCount
in interface Statistics
public long getPrepareStatementCount()
Statistics
getPrepareStatementCount
in interface Statistics
public void optimisticFailure(String entityName)
StatisticsImplementor
optimisticFailure
in interface StatisticsImplementor
entityName
- The name of the entity.public long getOptimisticFailureCount()
Statistics
getOptimisticFailureCount
in interface Statistics
public String getQueryExecutionMaxTimeQueryString()
Statistics
getQueryExecutionMaxTimeQueryString
in interface Statistics
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.