@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)
StatisticsServiceMBean
setSessionFactoryJNDIName
in interface StatisticsServiceMBean
sfJNDIName
- session factory jndi nameStatisticsServiceMBean.setSessionFactoryJNDIName(java.lang.String)
public void setSessionFactory(SessionFactory sf)
sf
- session factory to registerpublic void clear()
Statistics
clear
in interface Statistics
Statistics.clear()
public EntityStatistics getEntityStatistics(String entityName)
Statistics
getEntityStatistics
in interface Statistics
entityName
- entity nameStatistics.getEntityStatistics(java.lang.String)
public CollectionStatistics getCollectionStatistics(String role)
Statistics
getCollectionStatistics
in interface Statistics
role
- collection roleStatistics.getCollectionStatistics(java.lang.String)
public SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName)
Statistics
getSecondLevelCacheStatistics
in interface Statistics
regionName
- region nameStatistics.getSecondLevelCacheStatistics(java.lang.String)
public QueryStatistics getQueryStatistics(String hql)
Statistics
getQueryStatistics
in interface Statistics
hql
- query stringStatistics.getQueryStatistics(java.lang.String)
public long getEntityDeleteCount()
Statistics
getEntityDeleteCount
in interface Statistics
Statistics.getEntityDeleteCount()
public long getEntityInsertCount()
Statistics
getEntityInsertCount
in interface Statistics
Statistics.getEntityInsertCount()
public long getEntityLoadCount()
Statistics
getEntityLoadCount
in interface Statistics
Statistics.getEntityLoadCount()
public long getEntityFetchCount()
Statistics
getEntityFetchCount
in interface Statistics
Statistics.getEntityFetchCount()
public long getEntityUpdateCount()
Statistics
getEntityUpdateCount
in interface Statistics
Statistics.getEntityUpdateCount()
public long getQueryExecutionCount()
Statistics
getQueryExecutionCount
in interface Statistics
Statistics.getQueryExecutionCount()
public long getQueryCacheHitCount()
Statistics
getQueryCacheHitCount
in interface Statistics
public long getQueryExecutionMaxTime()
Statistics
getQueryExecutionMaxTime
in interface Statistics
public long getQueryCacheMissCount()
Statistics
getQueryCacheMissCount
in interface Statistics
public long getQueryCachePutCount()
Statistics
getQueryCachePutCount
in interface Statistics
public long getUpdateTimestampsCacheHitCount()
Statistics
getUpdateTimestampsCacheHitCount
in interface Statistics
public long getUpdateTimestampsCacheMissCount()
Statistics
getUpdateTimestampsCacheMissCount
in interface Statistics
public long getUpdateTimestampsCachePutCount()
Statistics
getUpdateTimestampsCachePutCount
in interface Statistics
public long getFlushCount()
Statistics
getFlushCount
in interface Statistics
Statistics.getFlushCount()
public long getConnectCount()
Statistics
getConnectCount
in interface Statistics
Statistics.getConnectCount()
public long getSecondLevelCacheHitCount()
Statistics
getSecondLevelCacheHitCount
in interface Statistics
Statistics.getSecondLevelCacheHitCount()
public long getSecondLevelCacheMissCount()
Statistics
getSecondLevelCacheMissCount
in interface Statistics
Statistics.getSecondLevelCacheMissCount()
public long getSecondLevelCachePutCount()
Statistics
getSecondLevelCachePutCount
in interface Statistics
Statistics.getSecondLevelCachePutCount()
public NaturalIdCacheStatistics getNaturalIdCacheStatistics(String regionName)
Statistics
getNaturalIdCacheStatistics
in interface Statistics
regionName
- region namepublic long getNaturalIdCacheHitCount()
Statistics
getNaturalIdCacheHitCount
in interface Statistics
public long getNaturalIdCacheMissCount()
Statistics
getNaturalIdCacheMissCount
in interface Statistics
public long getNaturalIdCachePutCount()
Statistics
getNaturalIdCachePutCount
in interface Statistics
public long getNaturalIdQueryExecutionCount()
Statistics
getNaturalIdQueryExecutionCount
in interface Statistics
public long getNaturalIdQueryExecutionMaxTime()
Statistics
getNaturalIdQueryExecutionMaxTime
in interface Statistics
public String getNaturalIdQueryExecutionMaxTimeRegion()
Statistics
getNaturalIdQueryExecutionMaxTimeRegion
in interface Statistics
public long getSessionCloseCount()
Statistics
getSessionCloseCount
in interface Statistics
Statistics.getSessionCloseCount()
public long getSessionOpenCount()
Statistics
getSessionOpenCount
in interface Statistics
Statistics.getSessionOpenCount()
public long getCollectionLoadCount()
Statistics
getCollectionLoadCount
in interface Statistics
Statistics.getCollectionLoadCount()
public long getCollectionFetchCount()
Statistics
getCollectionFetchCount
in interface Statistics
Statistics.getCollectionFetchCount()
public long getCollectionUpdateCount()
Statistics
getCollectionUpdateCount
in interface Statistics
Statistics.getCollectionUpdateCount()
public long getCollectionRemoveCount()
Statistics
getCollectionRemoveCount
in interface Statistics
Statistics.getCollectionRemoveCount()
public long getCollectionRecreateCount()
Statistics
getCollectionRecreateCount
in interface Statistics
Statistics.getCollectionRecreateCount()
public long getStartTime()
getStartTime
in interface Statistics
System.currentTimeMillis()
)Statistics.getStartTime()
public boolean isStatisticsEnabled()
Statistics
isStatisticsEnabled
in interface Statistics
Statistics.isStatisticsEnabled()
public void setStatisticsEnabled(boolean enable)
Statistics
setStatisticsEnabled
in interface Statistics
Statistics.setStatisticsEnabled(boolean)
public void logSummary()
Statistics
logSummary
in interface Statistics
public String[] getCollectionRoleNames()
Statistics
getCollectionRoleNames
in interface Statistics
public String[] getEntityNames()
Statistics
getEntityNames
in interface Statistics
public String[] getQueries()
Statistics
getQueries
in interface Statistics
public String[] getSecondLevelCacheRegionNames()
Statistics
getSecondLevelCacheRegionNames
in interface Statistics
public long getSuccessfulTransactionCount()
Statistics
getSuccessfulTransactionCount
in interface Statistics
public long getTransactionCount()
Statistics
getTransactionCount
in interface Statistics
public long getCloseStatementCount()
Statistics
getCloseStatementCount
in interface Statistics
public long getPrepareStatementCount()
Statistics
getPrepareStatementCount
in interface Statistics
public long getOptimisticFailureCount()
Statistics
getOptimisticFailureCount
in interface Statistics
public String getQueryExecutionMaxTimeQueryString()
Statistics
getQueryExecutionMaxTimeQueryString
in interface Statistics
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.