@Deprecated public class StatisticsService extends Object implements StatisticsServiceMBean
//build the ObjectName you want
Hashtable tb = new Hashtable();
tb.put("type", "statistics");
tb.put("sessionFactory", "myFinancialApp");
ObjectName on = new ObjectName("hibernate", tb);
StatisticsService stats = new StatisticsService();
stats.setSessionFactory(sessionFactory);
server.registerMBean(stats, on);
And call the MBean the way you want
//build the ObjectName you want
Hashtable tb = new Hashtable();
tb.put("type", "statistics");
tb.put("sessionFactory", "myFinancialApp");
ObjectName on = new ObjectName("hibernate", tb);
StatisticsService stats = new StatisticsService();
server.registerMBean(stats, on);
And call the MBean by providing the SessionFactoryJNDIName first.
Then the session factory will be retrieved from JNDI and the statistics
loaded.| Constructor and Description |
|---|
StatisticsService()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
reset all statistics
|
long |
getCloseStatementCount()
Deprecated.
The number of prepared statements that were released
|
long |
getCollectionFetchCount()
Deprecated.
Global number of collections fetched
|
long |
getCollectionLoadCount()
Deprecated.
Global number of collections loaded
|
long |
getCollectionRecreateCount()
Deprecated.
Global number of collections recreated
|
long |
getCollectionRemoveCount()
Deprecated.
Global number of collections removed
|
String[] |
getCollectionRoleNames()
Deprecated.
Get the names of all collection roles
|
CollectionStatistics |
getCollectionStatistics(String role)
Deprecated.
Get collection statistics per role
|
long |
getCollectionUpdateCount()
Deprecated.
Global number of collections updated
|
long |
getConnectCount()
Deprecated.
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()
Deprecated.
Get global number of entity deletes
|
long |
getEntityFetchCount()
Deprecated.
Get global number of entity fetchs
|
long |
getEntityInsertCount()
Deprecated.
Get global number of entity inserts
|
long |
getEntityLoadCount()
Deprecated.
Get global number of entity loads
|
String[] |
getEntityNames()
Deprecated.
Get the names of all entities
|
EntityStatistics |
getEntityStatistics(String entityName)
Deprecated.
find entity statistics per name
|
long |
getEntityUpdateCount()
Deprecated.
Get global number of entity updates
|
long |
getFlushCount()
Deprecated.
Get the global number of flush executed by sessions (either implicit or explicit)
|
long |
getNaturalIdCacheHitCount()
Deprecated.
Get the global number of cached naturalId lookups successfully retrieved from cache
|
long |
getNaturalIdCacheMissCount()
Deprecated.
Get the global number of cached naturalId lookups *not* found in cache
|
long |
getNaturalIdCachePutCount()
Deprecated.
Get the global number of cacheable naturalId lookups put in cache
|
NaturalIdCacheStatistics |
getNaturalIdCacheStatistics(String regionName)
Deprecated.
Natural id cache statistics per region
|
long |
getNaturalIdQueryExecutionCount()
Deprecated.
Get the global number of naturalId queries executed against the database
|
long |
getNaturalIdQueryExecutionMaxTime()
Deprecated.
Get the global maximum query time for naturalId queries executed against the database
|
String |
getNaturalIdQueryExecutionMaxTimeRegion()
Deprecated.
Get the region for the maximum naturalId query time
|
long |
getOptimisticFailureCount()
Deprecated.
The number of StaleObjectStateExceptions
that occurred
|
long |
getPrepareStatementCount()
Deprecated.
The number of prepared statements that were acquired
|
String[] |
getQueries()
Deprecated.
Get all executed query strings
|
long |
getQueryCacheHitCount()
Deprecated.
Get the global number of cached queries successfully retrieved from cache
|
long |
getQueryCacheMissCount()
Deprecated.
Get the global number of cached queries *not* found in cache
|
long |
getQueryCachePutCount()
Deprecated.
Get the global number of cacheable queries put in cache
|
long |
getQueryExecutionCount()
Deprecated.
Get global number of executed queries
|
long |
getQueryExecutionMaxTime()
Deprecated.
Get the time in milliseconds of the slowest query.
|
String |
getQueryExecutionMaxTimeQueryString()
Deprecated.
Get the query string for the slowest query.
|
QueryStatistics |
getQueryStatistics(String hql)
Deprecated.
Query statistics from query string (HQL or SQL)
|
long |
getSecondLevelCacheHitCount()
Deprecated.
Global number of cacheable entities/collections successfully retrieved from the cache
|
long |
getSecondLevelCacheMissCount()
Deprecated.
Global number of cacheable entities/collections not found in the cache and loaded from the database.
|
long |
getSecondLevelCachePutCount()
Deprecated.
Global number of cacheable entities/collections put in the cache
|
String[] |
getSecondLevelCacheRegionNames()
Deprecated.
Get all second-level cache region names
|
SecondLevelCacheStatistics |
getSecondLevelCacheStatistics(String regionName)
Deprecated.
Second level cache statistics per region
|
long |
getSessionCloseCount()
Deprecated.
Global number of sessions closed
|
long |
getSessionOpenCount()
Deprecated.
Global number of sessions opened
|
long |
getStartTime()
Deprecated.
|
long |
getSuccessfulTransactionCount()
Deprecated.
The number of transactions we know to have been successful
|
long |
getTransactionCount()
Deprecated.
The number of transactions we know to have completed
|
long |
getUpdateTimestampsCacheHitCount()
Deprecated.
Get the global number of timestamps successfully retrieved from cache
|
long |
getUpdateTimestampsCacheMissCount()
Deprecated.
Get the global number of tables for which no update timestamps was *not* found in cache
|
long |
getUpdateTimestampsCachePutCount()
Deprecated.
Get the global number of timestamps put in cache
|
boolean |
isStatisticsEnabled()
Deprecated.
Are statistics logged
|
void |
logSummary()
Deprecated.
log in info level the main statistics
|
void |
setSessionFactory(SessionFactory sf)
Deprecated.
Useful to init this MBean wo a JNDI session factory name
|
void |
setSessionFactoryJNDIName(String sfJNDIName)
Deprecated.
Publish the statistics of a session factory bound to
the default JNDI context
|
void |
setStatisticsEnabled(boolean enable)
Deprecated.
Enable statistics logs (this is a dynamic parameter)
|
public void setSessionFactoryJNDIName(String sfJNDIName)
StatisticsServiceMBeansetSessionFactoryJNDIName in interface StatisticsServiceMBeansfJNDIName - session factory jndi nameStatisticsServiceMBean.setSessionFactoryJNDIName(java.lang.String)public void setSessionFactory(SessionFactory sf)
sf - session factory to registerpublic void clear()
Statisticsclear in interface StatisticsStatistics.clear()public EntityStatistics getEntityStatistics(String entityName)
StatisticsgetEntityStatistics in interface StatisticsentityName - entity nameStatistics.getEntityStatistics(java.lang.String)public CollectionStatistics getCollectionStatistics(String role)
StatisticsgetCollectionStatistics in interface Statisticsrole - collection roleStatistics.getCollectionStatistics(java.lang.String)public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName)
StatisticsgetSecondLevelCacheStatistics in interface StatisticsregionName - region nameStatistics.getSecondLevelCacheStatistics(java.lang.String)public QueryStatistics getQueryStatistics(String hql)
StatisticsgetQueryStatistics in interface Statisticshql - query stringStatistics.getQueryStatistics(java.lang.String)public long getEntityDeleteCount()
StatisticsgetEntityDeleteCount in interface StatisticsStatistics.getEntityDeleteCount()public long getEntityInsertCount()
StatisticsgetEntityInsertCount in interface StatisticsStatistics.getEntityInsertCount()public long getEntityLoadCount()
StatisticsgetEntityLoadCount in interface StatisticsStatistics.getEntityLoadCount()public long getEntityFetchCount()
StatisticsgetEntityFetchCount in interface StatisticsStatistics.getEntityFetchCount()public long getEntityUpdateCount()
StatisticsgetEntityUpdateCount in interface StatisticsStatistics.getEntityUpdateCount()public long getQueryExecutionCount()
StatisticsgetQueryExecutionCount in interface StatisticsStatistics.getQueryExecutionCount()public long getQueryCacheHitCount()
StatisticsgetQueryCacheHitCount in interface Statisticspublic long getQueryExecutionMaxTime()
StatisticsgetQueryExecutionMaxTime in interface Statisticspublic long getQueryCacheMissCount()
StatisticsgetQueryCacheMissCount in interface Statisticspublic long getQueryCachePutCount()
StatisticsgetQueryCachePutCount in interface Statisticspublic long getUpdateTimestampsCacheHitCount()
StatisticsgetUpdateTimestampsCacheHitCount in interface Statisticspublic long getUpdateTimestampsCacheMissCount()
StatisticsgetUpdateTimestampsCacheMissCount in interface Statisticspublic long getUpdateTimestampsCachePutCount()
StatisticsgetUpdateTimestampsCachePutCount in interface Statisticspublic long getFlushCount()
StatisticsgetFlushCount in interface StatisticsStatistics.getFlushCount()public long getConnectCount()
StatisticsgetConnectCount in interface StatisticsStatistics.getConnectCount()public long getSecondLevelCacheHitCount()
StatisticsgetSecondLevelCacheHitCount in interface StatisticsStatistics.getSecondLevelCacheHitCount()public long getSecondLevelCacheMissCount()
StatisticsgetSecondLevelCacheMissCount in interface StatisticsStatistics.getSecondLevelCacheMissCount()public long getSecondLevelCachePutCount()
StatisticsgetSecondLevelCachePutCount in interface StatisticsStatistics.getSecondLevelCachePutCount()public NaturalIdCacheStatistics getNaturalIdCacheStatistics(String regionName)
StatisticsgetNaturalIdCacheStatistics in interface StatisticsregionName - region namepublic long getNaturalIdCacheHitCount()
StatisticsgetNaturalIdCacheHitCount in interface Statisticspublic long getNaturalIdCacheMissCount()
StatisticsgetNaturalIdCacheMissCount in interface Statisticspublic long getNaturalIdCachePutCount()
StatisticsgetNaturalIdCachePutCount in interface Statisticspublic long getNaturalIdQueryExecutionCount()
StatisticsgetNaturalIdQueryExecutionCount in interface Statisticspublic long getNaturalIdQueryExecutionMaxTime()
StatisticsgetNaturalIdQueryExecutionMaxTime in interface Statisticspublic String getNaturalIdQueryExecutionMaxTimeRegion()
StatisticsgetNaturalIdQueryExecutionMaxTimeRegion in interface Statisticspublic long getSessionCloseCount()
StatisticsgetSessionCloseCount in interface StatisticsStatistics.getSessionCloseCount()public long getSessionOpenCount()
StatisticsgetSessionOpenCount in interface StatisticsStatistics.getSessionOpenCount()public long getCollectionLoadCount()
StatisticsgetCollectionLoadCount in interface StatisticsStatistics.getCollectionLoadCount()public long getCollectionFetchCount()
StatisticsgetCollectionFetchCount in interface StatisticsStatistics.getCollectionFetchCount()public long getCollectionUpdateCount()
StatisticsgetCollectionUpdateCount in interface StatisticsStatistics.getCollectionUpdateCount()public long getCollectionRemoveCount()
StatisticsgetCollectionRemoveCount in interface StatisticsStatistics.getCollectionRemoveCount()public long getCollectionRecreateCount()
StatisticsgetCollectionRecreateCount in interface StatisticsStatistics.getCollectionRecreateCount()public long getStartTime()
getStartTime in interface StatisticsSystem.currentTimeMillis())Statistics.getStartTime()public boolean isStatisticsEnabled()
StatisticsisStatisticsEnabled in interface StatisticsStatistics.isStatisticsEnabled()public void setStatisticsEnabled(boolean enable)
StatisticssetStatisticsEnabled in interface StatisticsStatistics.setStatisticsEnabled(boolean)public void logSummary()
StatisticslogSummary in interface Statisticspublic String[] getCollectionRoleNames()
StatisticsgetCollectionRoleNames in interface Statisticspublic String[] getEntityNames()
StatisticsgetEntityNames in interface Statisticspublic String[] getQueries()
StatisticsgetQueries in interface Statisticspublic String[] getSecondLevelCacheRegionNames()
StatisticsgetSecondLevelCacheRegionNames 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 long getOptimisticFailureCount()
StatisticsgetOptimisticFailureCount in interface Statisticspublic String getQueryExecutionMaxTimeQueryString()
StatisticsgetQueryExecutionMaxTimeQueryString in interface StatisticsCopyright © 2012 JBoss by Red Hat. All Rights Reserved.