Top Fields Constructors Methods
org.hibernate.stat

public Class StatisticsImpl

extends Object
implements Statistics, StatisticsImplementor
Class Inheritance
All Implemented Interfaces
org.hibernate.stat.StatisticsImplementor, org.hibernate.stat.Statistics
Annotations
@Deprecated
Imports
java.util.HashMap, .Map, org.slf4j.Logger, .LoggerFactory, org.hibernate.cache.Region, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.util.ArrayHelper

Deprecated

Use org.hibernate.stat.ConcurrentStatisticsImpl instead

Author
Gavin King
See Also
org.hibernate.stat.Statistics

Field Summary

Modifier and TypeField and Description
private long
private long
private long
private long
private long
private final Map<K, V>
collectionStatistics

collection statistics per name

private long
private long
private long
private long
private long
private long
private long
private final Map<K, V>
entityStatistics

entity statistics per name

private long
private long
private boolean
private static final Logger
private long
private long
private long
private long
private long
private long
private long
private String
private final Map<K, V>
queryStatistics

entity statistics per query string (HQL or SQL)

private long
private long
private long
private final Map<K, V>
secondLevelCacheStatistics

second level cache statistics per region

private long
private SessionFactoryImplementor
private long
private long
private long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
clear()

Implements org.hibernate.stat.Statistics.clear.

reset all statistics
public synchronized void
closeSession()

Implements org.hibernate.stat.StatisticsImplementor.closeSession.

Callback about a session being closed.
public void
closeStatement()

Implements org.hibernate.stat.StatisticsImplementor.closeStatement.

Callback about a statement being closed.
public synchronized void
public synchronized void
deleteEntity(String
The name of the entity deleted.
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.deleteEntity.

Callback about an entity being deleted.
public void
endTransaction(boolean
Was the transaction successful?
success
)

Implements org.hibernate.stat.StatisticsImplementor.endTransaction.

Callback about a transaction completing.
public synchronized void
fetchCollection(String
The collection role.
role
)

Implements org.hibernate.stat.StatisticsImplementor.fetchCollection.

Callback to indicate a collection being fetched.
public synchronized void
fetchEntity(String
The name of the entity fetched.
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.fetchEntity.

Callback about an entity being fetched.
public synchronized void
flush()

Implements org.hibernate.stat.StatisticsImplementor.flush.

Callback about a flush occurring
public long
getCloseStatementCount()

Implements org.hibernate.stat.Statistics.getCloseStatementCount.

The number of prepared statements that were released
public long

Returns:

collection fetching (from DB)
getCollectionFetchCount
()

Implements org.hibernate.stat.Statistics.getCollectionFetchCount.

Global number of collections fetched
public long

Returns:

collection loading (from DB)
getCollectionLoadCount
()

Implements org.hibernate.stat.Statistics.getCollectionLoadCount.

Global number of collections loaded
public long

Returns:

collection recreation
getCollectionRecreateCount
()

Implements org.hibernate.stat.Statistics.getCollectionRecreateCount.

Global number of collections recreated
public long

Returns:

collection removal FIXME: even if isInverse="true"?
getCollectionRemoveCount
()

Implements org.hibernate.stat.Statistics.getCollectionRemoveCount.

Global number of collections removed
public String[]
getCollectionRoleNames()

Implements org.hibernate.stat.Statistics.getCollectionRoleNames.

Get the names of all collection roles
public synchronized CollectionStatistics

Returns:

CollectionStatistics
getCollectionStatistics
(String
collection role
role
)

Implements org.hibernate.stat.Statistics.getCollectionStatistics.

Get collection statistics per role
public long

Returns:

collection update
getCollectionUpdateCount
()

Implements org.hibernate.stat.Statistics.getCollectionUpdateCount.

Global number of collections updated
public long

Returns:

session connect
getConnectCount
()

Implements org.hibernate.stat.Statistics.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)
public long

Returns:

entity deletion count
getEntityDeleteCount
()

Implements org.hibernate.stat.Statistics.getEntityDeleteCount.

Get global number of entity deletes
public long

Returns:

entity fetch (from DB)
getEntityFetchCount
()

Implements org.hibernate.stat.Statistics.getEntityFetchCount.

Get global number of entity fetchs
public long

Returns:

entity insertion count
getEntityInsertCount
()

Implements org.hibernate.stat.Statistics.getEntityInsertCount.

Get global number of entity inserts
public long

Returns:

entity load (from DB)
getEntityLoadCount
()

Implements org.hibernate.stat.Statistics.getEntityLoadCount.

Get global number of entity loads
public String[]
getEntityNames()

Implements org.hibernate.stat.Statistics.getEntityNames.

Get the names of all entities
public synchronized EntityStatistics

Returns:

EntityStatistics object
getEntityStatistics
(String
entity name
entityName
)

Implements org.hibernate.stat.Statistics.getEntityStatistics.

find entity statistics per name
public long

Returns:

entity update
getEntityUpdateCount
()

Implements org.hibernate.stat.Statistics.getEntityUpdateCount.

Get global number of entity updates
public long

Returns:

flush
getFlushCount
()

Implements org.hibernate.stat.Statistics.getFlushCount.

Get the global number of flush executed by sessions (either implicit or explicit)
public long
getOptimisticFailureCount()

Implements org.hibernate.stat.Statistics.getOptimisticFailureCount.

The number of StaleObjectStateExceptions that occurred
public long
getPrepareStatementCount()

Implements org.hibernate.stat.Statistics.getPrepareStatementCount.

The number of prepared statements that were acquired
public String[]
getQueries()

Implements org.hibernate.stat.Statistics.getQueries.

Get all executed query strings
public long
getQueryCacheHitCount()

Implements org.hibernate.stat.Statistics.getQueryCacheHitCount.

Get the global number of cached queries successfully retrieved from cache
public long
getQueryCacheMissCount()

Implements org.hibernate.stat.Statistics.getQueryCacheMissCount.

Get the global number of cached queries *not* found in cache
public long
getQueryCachePutCount()

Implements org.hibernate.stat.Statistics.getQueryCachePutCount.

Get the global number of cacheable queries put in cache
public long
getQueryExecutionCount()

Implements org.hibernate.stat.Statistics.getQueryExecutionCount.

Get global number of executed queries
public long

Returns:

Returns the max query execution time, for all queries
getQueryExecutionMaxTime
()

Implements org.hibernate.stat.Statistics.getQueryExecutionMaxTime.

Get the time in milliseconds of the slowest query.
public String
public synchronized QueryStatistics

Returns:

QueryStatistics
getQueryStatistics
(String
query string
queryString
)

Implements org.hibernate.stat.Statistics.getQueryStatistics.

Query statistics from query string (HQL or SQL)
public long

Returns:

second level cache hit
getSecondLevelCacheHitCount
()

Implements org.hibernate.stat.Statistics.getSecondLevelCacheHitCount.

Global number of cacheable entities/collections successfully retrieved from the cache
public long

Returns:

second level cache miss
getSecondLevelCacheMissCount
()

Implements org.hibernate.stat.Statistics.getSecondLevelCacheMissCount.

Global number of cacheable entities/collections not found in the cache and loaded from the database.
public long

Returns:

second level cache put
getSecondLevelCachePutCount
()

Implements org.hibernate.stat.Statistics.getSecondLevelCachePutCount.

Global number of cacheable entities/collections put in the cache
public String[]
public synchronized SecondLevelCacheStatistics

Returns:

SecondLevelCacheStatistics
getSecondLevelCacheStatistics
(String
region name
regionName
)

Implements org.hibernate.stat.Statistics.getSecondLevelCacheStatistics.

Second level cache statistics per region
public long

Returns:

session closing
getSessionCloseCount
()

Implements org.hibernate.stat.Statistics.getSessionCloseCount.

Global number of sessions closed
public long

Returns:

session opening
getSessionOpenCount
()

Implements org.hibernate.stat.Statistics.getSessionOpenCount.

Global number of sessions opened
public long

Returns:

start time in ms (JVM standards System#currentTimeMillis())
getStartTime
()

Implements org.hibernate.stat.Statistics.getStartTime.

public long
getSuccessfulTransactionCount()

Implements org.hibernate.stat.Statistics.getSuccessfulTransactionCount.

The number of transactions we know to have been successful
public long
getTransactionCount()

Implements org.hibernate.stat.Statistics.getTransactionCount.

The number of transactions we know to have completed
public synchronized void
insertEntity(String
The name of the entity inserted
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.insertEntity.

Callback about an entity being inserted
public boolean
public synchronized void
loadCollection(String
The collection role.
role
)

Implements org.hibernate.stat.StatisticsImplementor.loadCollection.

Callback about a collection loading.
public synchronized void
loadEntity(String
The name of the entity loaded.
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.loadEntity.

Callback about an entity being loaded.
public void
logSummary()

Implements org.hibernate.stat.Statistics.logSummary.

log in info level the main statistics
public synchronized void
openSession()

Implements org.hibernate.stat.StatisticsImplementor.openSession.

Callback about a session being opened.
public void
optimisticFailure(String
The name of the entity.
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.optimisticFailure.

Callback about an optimistic lock failure on an entity
public void
prepareStatement()

Implements org.hibernate.stat.StatisticsImplementor.prepareStatement.

Callback about a statement being prepared.
public synchronized void
queryCacheHit(String
The query
hql
,
String
The name of the cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.queryCacheHit.

Callback indicating a get from the query cache resulted in a hit.
public synchronized void
queryCacheMiss(String
The query
hql
,
String
The name of the cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.queryCacheMiss.

Callback indicating a get from the query cache resulted in a miss.
public synchronized void
queryCachePut(String
The query
hql
,
String
The cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.queryCachePut.

Callback indicating a put into the query cache.
public synchronized void
queryExecuted(String
The query
hql
,
int
Number of rows returned
rows
,
long
execution time
time
)

Implements org.hibernate.stat.StatisticsImplementor.queryExecuted.

Callback indicating execution of a sql/hql query
public synchronized void
recreateCollection(String
The collection role.
role
)

Implements org.hibernate.stat.StatisticsImplementor.recreateCollection.

Callback indicating a collection recreation (full deletion + full (re-)insertion).
public synchronized void
removeCollection(String
The collection role.
role
)

Implements org.hibernate.stat.StatisticsImplementor.removeCollection.

Callback indicating a collection removal.
public synchronized void
secondLevelCacheHit(String
The name of the cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.secondLevelCacheHit.

Callback indicating a get from second level cache resulted in a hit.
public synchronized void
secondLevelCacheMiss(String
The name of the cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.secondLevelCacheMiss.

Callback indicating a get from second level cache resulted in a miss.
public synchronized void
secondLevelCachePut(String
The name of the cache region
regionName
)

Implements org.hibernate.stat.StatisticsImplementor.secondLevelCachePut.

Callback indicating a put into second level cache.
public void
setStatisticsEnabled(boolean b)

Implements org.hibernate.stat.Statistics.setStatisticsEnabled.

Enable statistics logs (this is a dynamic parameter)
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public synchronized void
updateCollection(String
The collection role.
role
)

Implements org.hibernate.stat.StatisticsImplementor.updateCollection.

Callback indicating a collection was updated.
public synchronized void
updateEntity(String
The name of the entity updated.
entityName
)

Implements org.hibernate.stat.StatisticsImplementor.updateEntity.

Callback about an entity being updated.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait