org.hibernate.jmx
Class StatisticsService
java.lang.Object
org.hibernate.jmx.StatisticsService
- All Implemented Interfaces:
- StatisticsServiceMBean, Statistics
public class StatisticsService
- extends Object
- implements StatisticsServiceMBean
JMX service for Hibernate statistics
Register this MBean in your JMX server for a specific session factory
//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
Register this MBean in your JMX server with no specific session factory
//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.
- Author:
- Emmanuel Bernard
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StatisticsService
public StatisticsService()
setSessionFactoryJNDIName
public void setSessionFactoryJNDIName(String sfJNDIName)
- Description copied from interface:
StatisticsServiceMBean
- Publish the statistics of a session factory bound to
the default JNDI context
- Specified by:
setSessionFactoryJNDIName
in interface StatisticsServiceMBean
- Parameters:
sfJNDIName
- session factory jndi name- See Also:
StatisticsServiceMBean.setSessionFactoryJNDIName(java.lang.String)
setSessionFactory
public void setSessionFactory(SessionFactory sf)
- Useful to init this MBean wo a JNDI session factory name
- Parameters:
sf
- session factory to register
clear
public void clear()
- Specified by:
clear
in interface Statistics
- See Also:
Statistics.clear()
getEntityStatistics
public EntityStatistics getEntityStatistics(String entityName)
- Specified by:
getEntityStatistics
in interface Statistics
- See Also:
Statistics.getEntityStatistics(java.lang.String)
getCollectionStatistics
public CollectionStatistics getCollectionStatistics(String role)
- Specified by:
getCollectionStatistics
in interface Statistics
- See Also:
Statistics.getCollectionStatistics(java.lang.String)
getSecondLevelCacheStatistics
public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName)
- Specified by:
getSecondLevelCacheStatistics
in interface Statistics
- See Also:
Statistics.getSecondLevelCacheStatistics(java.lang.String)
getQueryStatistics
public QueryStatistics getQueryStatistics(String hql)
- Specified by:
getQueryStatistics
in interface Statistics
- See Also:
Statistics.getQueryStatistics(java.lang.String)
getEntityDeleteCount
public long getEntityDeleteCount()
- Specified by:
getEntityDeleteCount
in interface Statistics
- See Also:
Statistics.getEntityDeleteCount()
getEntityInsertCount
public long getEntityInsertCount()
- Specified by:
getEntityInsertCount
in interface Statistics
- See Also:
Statistics.getEntityInsertCount()
getEntityLoadCount
public long getEntityLoadCount()
- Specified by:
getEntityLoadCount
in interface Statistics
- See Also:
Statistics.getEntityLoadCount()
getEntityFetchCount
public long getEntityFetchCount()
- Specified by:
getEntityFetchCount
in interface Statistics
- See Also:
Statistics.getEntityFetchCount()
getEntityUpdateCount
public long getEntityUpdateCount()
- Specified by:
getEntityUpdateCount
in interface Statistics
- See Also:
Statistics.getEntityUpdateCount()
getQueryExecutionCount
public long getQueryExecutionCount()
- Specified by:
getQueryExecutionCount
in interface Statistics
- See Also:
Statistics.getQueryExecutionCount()
getQueryCacheHitCount
public long getQueryCacheHitCount()
- Specified by:
getQueryCacheHitCount
in interface Statistics
getQueryExecutionMaxTime
public long getQueryExecutionMaxTime()
- Specified by:
getQueryExecutionMaxTime
in interface Statistics
getQueryCacheMissCount
public long getQueryCacheMissCount()
- Specified by:
getQueryCacheMissCount
in interface Statistics
getQueryCachePutCount
public long getQueryCachePutCount()
- Specified by:
getQueryCachePutCount
in interface Statistics
getFlushCount
public long getFlushCount()
- Specified by:
getFlushCount
in interface Statistics
- See Also:
Statistics.getFlushCount()
getConnectCount
public long getConnectCount()
- Specified by:
getConnectCount
in interface Statistics
- See Also:
Statistics.getConnectCount()
getSecondLevelCacheHitCount
public long getSecondLevelCacheHitCount()
- Specified by:
getSecondLevelCacheHitCount
in interface Statistics
- See Also:
Statistics.getSecondLevelCacheHitCount()
getSecondLevelCacheMissCount
public long getSecondLevelCacheMissCount()
- Specified by:
getSecondLevelCacheMissCount
in interface Statistics
- See Also:
Statistics.getSecondLevelCacheMissCount()
getSecondLevelCachePutCount
public long getSecondLevelCachePutCount()
- Specified by:
getSecondLevelCachePutCount
in interface Statistics
- See Also:
Statistics.getSecondLevelCachePutCount()
getSessionCloseCount
public long getSessionCloseCount()
- Specified by:
getSessionCloseCount
in interface Statistics
- See Also:
Statistics.getSessionCloseCount()
getSessionOpenCount
public long getSessionOpenCount()
- Specified by:
getSessionOpenCount
in interface Statistics
- See Also:
Statistics.getSessionOpenCount()
getCollectionLoadCount
public long getCollectionLoadCount()
- Specified by:
getCollectionLoadCount
in interface Statistics
- See Also:
Statistics.getCollectionLoadCount()
getCollectionFetchCount
public long getCollectionFetchCount()
- Specified by:
getCollectionFetchCount
in interface Statistics
- See Also:
Statistics.getCollectionFetchCount()
getCollectionUpdateCount
public long getCollectionUpdateCount()
- Specified by:
getCollectionUpdateCount
in interface Statistics
- See Also:
Statistics.getCollectionUpdateCount()
getCollectionRemoveCount
public long getCollectionRemoveCount()
- Specified by:
getCollectionRemoveCount
in interface Statistics
- See Also:
Statistics.getCollectionRemoveCount()
getCollectionRecreateCount
public long getCollectionRecreateCount()
- Specified by:
getCollectionRecreateCount
in interface Statistics
- See Also:
Statistics.getCollectionRecreateCount()
getStartTime
public long getStartTime()
- Specified by:
getStartTime
in interface Statistics
- See Also:
Statistics.getStartTime()
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabled
in interface Statistics
- See Also:
Statistics.isStatisticsEnabled()
setStatisticsEnabled
public void setStatisticsEnabled(boolean enable)
- Specified by:
setStatisticsEnabled
in interface Statistics
- See Also:
Statistics.setStatisticsEnabled(boolean)
logSummary
public void logSummary()
- Specified by:
logSummary
in interface Statistics
getCollectionRoleNames
public String[] getCollectionRoleNames()
- Specified by:
getCollectionRoleNames
in interface Statistics
getEntityNames
public String[] getEntityNames()
- Specified by:
getEntityNames
in interface Statistics
getQueries
public String[] getQueries()
- Specified by:
getQueries
in interface Statistics
getSecondLevelCacheRegionNames
public String[] getSecondLevelCacheRegionNames()
- Specified by:
getSecondLevelCacheRegionNames
in interface Statistics
getSuccessfulTransactionCount
public long getSuccessfulTransactionCount()
- Specified by:
getSuccessfulTransactionCount
in interface Statistics
getTransactionCount
public long getTransactionCount()
- Specified by:
getTransactionCount
in interface Statistics
getCloseStatementCount
public long getCloseStatementCount()
- Specified by:
getCloseStatementCount
in interface Statistics
getPrepareStatementCount
public long getPrepareStatementCount()
- Specified by:
getPrepareStatementCount
in interface Statistics
getOptimisticFailureCount
public long getOptimisticFailureCount()
- Specified by:
getOptimisticFailureCount
in interface Statistics
getQueryExecutionMaxTimeQueryString
public String getQueryExecutionMaxTimeQueryString()
- Specified by:
getQueryExecutionMaxTimeQueryString
in interface Statistics
Copyright © 2011 Hibernate.org. All Rights Reserved.