Class HibernateStatsImpl
- java.lang.Object
-
- javax.management.StandardMBean
-
- net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
-
- net.sf.ehcache.hibernate.management.impl.HibernateStatsImpl
-
- All Implemented Interfaces:
javax.management.DynamicMBean,javax.management.MBeanRegistration,javax.management.NotificationBroadcaster,javax.management.NotificationEmitter,HibernateStats
public class HibernateStatsImpl extends BaseEmitterBean implements HibernateStats
Implementation ofHibernateStats- Author:
- Abhishek Sanoujam
-
-
Field Summary
-
Fields inherited from class net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
emitter, sequenceNumber
-
Fields inherited from interface net.sf.ehcache.hibernate.management.api.HibernateStats
CACHE_ENABLED, CACHE_FLUSHED, CACHE_REGION_CHANGED, CACHE_REGION_FLUSHED, CACHE_STATISTICS_ENABLED, CACHE_STATISTICS_RESET
-
-
Constructor Summary
Constructors Constructor Description HibernateStatsImpl(org.hibernate.SessionFactory sessionFactory)Constructor accepting the backingSessionFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearStats()Clears statistics, resets all counters to zerovoiddisableStats()Disables statistics collectionprotected voiddoDispose()Dispose callback of subclassesvoidenableStats()Enables statistics collectionjavax.management.openmbean.TabularDatagetCacheRegionStats()ReturnsTabularDataof cache region statslonggetCloseStatementCount()Returns the count of close statementsjavax.management.openmbean.TabularDatagetCollectionStats()ReturnsTabularDataof collection statslonggetConnectCount()Return connect countslonggetDBSQLExecutionSample()Not supported right nowjavax.management.openmbean.TabularDatagetEntityStats()ReturnsTabularDataof entity statslonggetFlushCount()Returns flush countjavax.management.MBeanNotificationInfo[]getNotificationInfo()longgetOptimisticFailureCount()Returns Optimistic failure countlonggetPrepareStatementCount()Returns prepare statement countlonggetQueryExecutionCount()Returns the query execution count.doublegetQueryExecutionRate()Returns rate of HQL query executed in the DBlonggetQueryExecutionSample()Returns last count sample of HQL's getting executed in the DB.javax.management.openmbean.TabularDatagetQueryStats()ReturnsTabularDataof query statslonggetSessionCloseCount()Returns session close countlonggetSessionOpenCount()Returns session open countlonggetSuccessfulTransactionCount()Returns successful transaction countlonggetTransactionCount()Returns transaction countbooleanisStatisticsEnabled()Returns true if statistics collection is enabled otherwise falsevoidsetStatisticsEnabled(boolean flag)Enable/Disable statistics collection-
Methods inherited from class net.sf.ehcache.hibernate.management.impl.BaseEmitterBean
addNotificationListener, dispose, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification
-
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
clearStats
public void clearStats()
Clears statistics, resets all counters to zero- Specified by:
clearStatsin interfaceHibernateStats- See Also:
HibernateStats.clearStats()
-
disableStats
public void disableStats()
Disables statistics collection- Specified by:
disableStatsin interfaceHibernateStats- See Also:
HibernateStats.disableStats()
-
enableStats
public void enableStats()
Enables statistics collection- Specified by:
enableStatsin interfaceHibernateStats- See Also:
HibernateStats.enableStats()
-
getCloseStatementCount
public long getCloseStatementCount()
Returns the count of close statements- Specified by:
getCloseStatementCountin interfaceHibernateStats- Returns:
- Returns the count of close statementss
- See Also:
HibernateStats.getCloseStatementCount()
-
getConnectCount
public long getConnectCount()
Return connect counts- Specified by:
getConnectCountin interfaceHibernateStats- Returns:
- Return connect counts
- See Also:
HibernateStats.getConnectCount()
-
getDBSQLExecutionSample
public long getDBSQLExecutionSample()
Not supported right now
-
getFlushCount
public long getFlushCount()
Returns flush count- Specified by:
getFlushCountin interfaceHibernateStats- Returns:
- Returns flush count
- See Also:
HibernateStats.getFlushCount()
-
getOptimisticFailureCount
public long getOptimisticFailureCount()
Returns Optimistic failure count- Specified by:
getOptimisticFailureCountin interfaceHibernateStats- Returns:
- Returns Optimistic failure count
- See Also:
HibernateStats.getOptimisticFailureCount()
-
getPrepareStatementCount
public long getPrepareStatementCount()
Returns prepare statement count- Specified by:
getPrepareStatementCountin interfaceHibernateStats- Returns:
- Returns prepare statement count
- See Also:
HibernateStats.getPrepareStatementCount()
-
getQueryExecutionCount
public long getQueryExecutionCount()
Returns the query execution count. This includes only HQL's- Specified by:
getQueryExecutionCountin interfaceHibernateStats- Returns:
- Returns the query execution count. This includes only HQL's
- See Also:
HibernateStats.getQueryExecutionCount()
-
getQueryExecutionRate
public double getQueryExecutionRate()
Returns rate of HQL query executed in the DB- Specified by:
getQueryExecutionRatein interfaceHibernateStats- Returns:
- Returns rate of HQL query executed in the DB
- See Also:
HibernateStats.getQueryExecutionRate()
-
getQueryExecutionSample
public long getQueryExecutionSample()
Returns last count sample of HQL's getting executed in the DB.- Specified by:
getQueryExecutionSamplein interfaceHibernateStats- Returns:
- Returns last count sample of HQL's getting executed in the DB.
- See Also:
HibernateStats.getQueryExecutionSample()
-
getSessionCloseCount
public long getSessionCloseCount()
Returns session close count- Specified by:
getSessionCloseCountin interfaceHibernateStats- Returns:
- Returns session close count
- See Also:
HibernateStats.getSessionCloseCount()
-
getSessionOpenCount
public long getSessionOpenCount()
Returns session open count- Specified by:
getSessionOpenCountin interfaceHibernateStats- Returns:
- Returns session open count
- See Also:
HibernateStats.getSessionOpenCount()
-
getSuccessfulTransactionCount
public long getSuccessfulTransactionCount()
Returns successful transaction count- Specified by:
getSuccessfulTransactionCountin interfaceHibernateStats- Returns:
- Returns successful transaction count
- See Also:
HibernateStats.getSuccessfulTransactionCount()
-
getTransactionCount
public long getTransactionCount()
Returns transaction count- Specified by:
getTransactionCountin interfaceHibernateStats- Returns:
- Returns transaction count
- See Also:
HibernateStats.getTransactionCount()
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
Returns true if statistics collection is enabled otherwise false- Specified by:
isStatisticsEnabledin interfaceHibernateStats- Returns:
- Returns true if statistics collection is enabled otherwise false
- See Also:
HibernateStats.isStatisticsEnabled()
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean flag)
Enable/Disable statistics collection- Specified by:
setStatisticsEnabledin interfaceHibernateStats- See Also:
HibernateStats.setStatisticsEnabled(boolean)
-
getEntityStats
public javax.management.openmbean.TabularData getEntityStats()
ReturnsTabularDataof entity stats- Specified by:
getEntityStatsin interfaceHibernateStats- Returns:
- Returns
TabularDataof entity stats - See Also:
HibernateStats.getEntityStats()
-
getCollectionStats
public javax.management.openmbean.TabularData getCollectionStats()
ReturnsTabularDataof collection stats- Specified by:
getCollectionStatsin interfaceHibernateStats- Returns:
- Returns
TabularDataof collection stats - See Also:
HibernateStats.getCollectionStats()
-
getQueryStats
public javax.management.openmbean.TabularData getQueryStats()
ReturnsTabularDataof query stats- Specified by:
getQueryStatsin interfaceHibernateStats- Returns:
- Returns
TabularDataof query stats - See Also:
HibernateStats.getQueryStats()
-
getCacheRegionStats
public javax.management.openmbean.TabularData getCacheRegionStats()
ReturnsTabularDataof cache region stats- Specified by:
getCacheRegionStatsin interfaceHibernateStats- Returns:
- Returns
TabularDataof cache region stats
-
doDispose
protected void doDispose()
Dispose callback of subclasses- Specified by:
doDisposein classBaseEmitterBean
-
getNotificationInfo
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
- Specified by:
getNotificationInfoin interfacejavax.management.NotificationBroadcaster- Specified by:
getNotificationInfoin classBaseEmitterBean- See Also:
BaseEmitterBean.getNotificationInfo()
-
-