FileDocCategorySizeDatePackage
Statistics.javaAPI DocHibernate 3.2.55407Fri Sep 30 02:48:54 BST 2005org.hibernate.stat

Statistics

public interface Statistics
Statistics for a particular SessionFactory. Beware of milliseconds metrics, they are depdendent of the JVM precision: you may then encounter a 10 ms approximation dending on you OS platform. Please refer to the JVM documentation for more information.
author
Emmanuel Bernard

Fields Summary
Constructors Summary
Methods Summary
public voidclear()
reset all statistics

public longgetCloseStatementCount()
The number of prepared statements that were released

public longgetCollectionFetchCount()
Global number of collections fetched

public longgetCollectionLoadCount()
Global number of collections loaded

public longgetCollectionRecreateCount()
Global number of collections recreated

public longgetCollectionRemoveCount()
Global number of collections removed

public java.lang.String[]getCollectionRoleNames()
Get the names of all collection roles

public CollectionStatisticsgetCollectionStatistics(java.lang.String role)
Get collection statistics per role

param
role collection role
return
CollectionStatistics

public longgetCollectionUpdateCount()
Global number of collections updated

public longgetConnectCount()
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 longgetEntityDeleteCount()
Get global number of entity deletes

return
entity deletion count

public longgetEntityFetchCount()
Get global number of entity fetchs

return
entity fetch (from DB)

public longgetEntityInsertCount()
Get global number of entity inserts

return
entity insertion count

public longgetEntityLoadCount()
Get global number of entity loads

return
entity load (from DB)

public java.lang.String[]getEntityNames()
Get the names of all entities

public EntityStatisticsgetEntityStatistics(java.lang.String entityName)
find entity statistics per name

param
entityName entity name
return
EntityStatistics object

public longgetEntityUpdateCount()
Get global number of entity updates

return
entity update

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

public longgetOptimisticFailureCount()
The number of StaleObjectStateExceptions that occurred

public longgetPrepareStatementCount()
The number of prepared statements that were acquired

public java.lang.String[]getQueries()
Get all executed query strings

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

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

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

public longgetQueryExecutionCount()
Get global number of executed queries

return
query execution count

public longgetQueryExecutionMaxTime()
Get the time in milliseconds of the slowest query.

public java.lang.StringgetQueryExecutionMaxTimeQueryString()
Get the query string for the slowest query.

public QueryStatisticsgetQueryStatistics(java.lang.String queryString)
Query statistics from query string (HQL or SQL)

param
queryString query string
return
QueryStatistics

public longgetSecondLevelCacheHitCount()
Global number of cacheable entities/collections successfully retrieved from the cache

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

public longgetSecondLevelCachePutCount()
Global number of cacheable entities/collections put in the cache

public java.lang.String[]getSecondLevelCacheRegionNames()
Get all second-level cache region names

public SecondLevelCacheStatisticsgetSecondLevelCacheStatistics(java.lang.String regionName)
Second level cache statistics per region

param
regionName region name
return
SecondLevelCacheStatistics

public longgetSessionCloseCount()
Global number of sessions closed

public longgetSessionOpenCount()
Global number of sessions opened

public longgetStartTime()

return
start time in ms (JVM standards {@link System#currentTimeMillis()})

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

public longgetTransactionCount()
The number of transactions we know to have completed

public booleanisStatisticsEnabled()
Are statistics logged

public voidlogSummary()
log in info level the main statistics

public voidsetStatisticsEnabled(boolean b)
Enable statistics logs (this is a dynamic parameter)