Interface EhcacheStats
-
- All Superinterfaces:
javax.management.NotificationBroadcaster,javax.management.NotificationEmitter
- All Known Subinterfaces:
EhcacheHibernateMBean
- All Known Implementing Classes:
EhcacheHibernate,EhcacheStatsImpl
public interface EhcacheStats extends javax.management.NotificationEmitterInterface for ehcache related statistics of hibernate second level cache- Author:
- Abhishek Sanoujam
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCACHE_ENABLEDCACHE_ENABLEDstatic java.lang.StringCACHE_FLUSHEDCACHE_FLUSHEDstatic java.lang.StringCACHE_REGION_CHANGEDCACHE_REGION_CHANGEDstatic java.lang.StringCACHE_REGION_FLUSHEDCACHE_REGION_FLUSHEDstatic java.lang.StringCACHE_STATISTICS_ENABLEDCACHE_STATISTICS_ENABLEDstatic java.lang.StringCACHE_STATISTICS_RESETCACHE_STATISTICS_RESET
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidflushRegionCache(java.lang.String region)Flushes the cache for the input regionvoidflushRegionCaches()Flushes all the caches for all the regionsjava.lang.StringgenerateActiveConfigDeclaration()Returns the currently active cache configurationjava.lang.StringgenerateActiveConfigDeclaration(java.lang.String region)Returns the currently active cache configuration for the supplied regionfloatgetAverageGetTimeMillis(java.lang.String region)Return average time taken in milliseconds for a get operation for the input cache namelonggetCacheHitCount()Returns hit count for all the cachesdoublegetCacheHitRate()Returns hit rate for all the cacheslonggetCacheHitSample()Returns hit count sample for all the cacheslonggetCacheMissCount()Returns miss count for all the cachesdoublegetCacheMissRate()Returns miss rate for all the cacheslonggetCacheMissSample()Returns miss count sample for all the cacheslonggetCachePutCount()Returns put count for all the cachesdoublegetCachePutRate()Returns put rate for all the cacheslonggetCachePutSample()Returns put count sample for all the cacheslonggetMaxGetTimeMillis()Return maximum time taken in milliseconds for a get operationlonggetMaxGetTimeMillis(java.lang.String cacheName)Return maximum time taken in milliseconds for a get operation for the input cache namelonggetMinGetTimeMillis()Return minimum time taken for a get operation in the cache in millisecondslonggetMinGetTimeMillis(java.lang.String cacheName)Return minimum time taken in milliseconds for a get operation for the input cache nameintgetNumberOfElementsInMemory(java.lang.String region)Returns number of elements in-memory in the cache for the input regionintgetNumberOfElementsOffHeap(java.lang.String region)Returns number of elements off-heap in the cache for the input regionintgetNumberOfElementsOnDisk(java.lang.String region)Returns number of elements on-disk in the cache for the input regionjava.lang.StringgetOriginalConfigDeclaration()Get the original cache configurationjava.lang.StringgetOriginalConfigDeclaration(java.lang.String region)Returns the original cache configuration for the supplied regionjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>getRegionCacheAttributes()Returns a map containing mapping of all cache region names to their attributesjava.util.Map<java.lang.String,java.lang.Object>getRegionCacheAttributes(java.lang.String regionName)Returns a map containing attributes of the cache for the input cache region nameintgetRegionCacheMaxTTISeconds(java.lang.String region)Returns the time to idle for the input cache regionintgetRegionCacheMaxTTLSeconds(java.lang.String region)Returns the time to live for the input cache regionintgetRegionCacheOrphanEvictionPeriod(java.lang.String region)Returns the orphan eviction period for the input cache region.java.util.Map<java.lang.String,int[]>getRegionCacheSamples()Returns a map containing mapping between cache names and an array containing hit, miss and put count samplesintgetRegionCacheTargetMaxInMemoryCount(java.lang.String region)Returns the maxElementsInMemory of the input cache regionintgetRegionCacheTargetMaxTotalCount(java.lang.String region)Returns the maxElementsOnDisk of the input cache regionjava.lang.String[]getTerracottaHibernateCacheRegionNames()Returns the region names which are clustered with terracottabooleanisRegionCacheEnabled(java.lang.String region)Returns true if cache is enabled for the input regionbooleanisRegionCacheLoggingEnabled(java.lang.String region)Returns true if logging is enabled for the input cache regionbooleanisRegionCacheOrphanEvictionEnabled(java.lang.String region)Returns true if orphan eviction is enabled for the region otherwise falsebooleanisRegionCachesEnabled()Returns true if all the cache regions are enabled.booleanisTerracottaHibernateCache(java.lang.String region)Returns true if the input region is clustered with terracottavoidsetRegionCacheEnabled(java.lang.String region, boolean enabled)Enables/disables a particular regionvoidsetRegionCacheLoggingEnabled(java.lang.String region, boolean loggingEnabled)Enable/Disable logging for the input cache regionvoidsetRegionCacheMaxTTISeconds(java.lang.String region, int maxTTISeconds)Sets the time to idle for the input cache regionvoidsetRegionCacheMaxTTLSeconds(java.lang.String region, int maxTTLSeconds)Sets the time to live for the input cache regionvoidsetRegionCachesEnabled(boolean enabled)Enable/disable all the cache regions.voidsetRegionCacheTargetMaxInMemoryCount(java.lang.String region, int targetMaxInMemoryCount)Sets the maxElementsInMemory of the input cache regionvoidsetRegionCacheTargetMaxTotalCount(java.lang.String region, int targetMaxTotalCount)Sets the maxElementsOnDisk of the input cache region
-
-
-
Field Detail
-
CACHE_ENABLED
static final java.lang.String CACHE_ENABLED
CACHE_ENABLED- See Also:
- Constant Field Values
-
CACHE_REGION_CHANGED
static final java.lang.String CACHE_REGION_CHANGED
CACHE_REGION_CHANGED- See Also:
- Constant Field Values
-
CACHE_FLUSHED
static final java.lang.String CACHE_FLUSHED
CACHE_FLUSHED- See Also:
- Constant Field Values
-
CACHE_REGION_FLUSHED
static final java.lang.String CACHE_REGION_FLUSHED
CACHE_REGION_FLUSHED- See Also:
- Constant Field Values
-
CACHE_STATISTICS_ENABLED
static final java.lang.String CACHE_STATISTICS_ENABLED
CACHE_STATISTICS_ENABLED- See Also:
- Constant Field Values
-
CACHE_STATISTICS_RESET
static final java.lang.String CACHE_STATISTICS_RESET
CACHE_STATISTICS_RESET- See Also:
- Constant Field Values
-
-
Method Detail
-
getOriginalConfigDeclaration
java.lang.String getOriginalConfigDeclaration()
Get the original cache configuration- Returns:
- the original cache configuration
-
getOriginalConfigDeclaration
java.lang.String getOriginalConfigDeclaration(java.lang.String region)
Returns the original cache configuration for the supplied region- Parameters:
region- for which the configuration is required- Returns:
- the original cache configuration for the supplied region
-
generateActiveConfigDeclaration
java.lang.String generateActiveConfigDeclaration()
Returns the currently active cache configuration- Returns:
- the currently active cache configuration
-
generateActiveConfigDeclaration
java.lang.String generateActiveConfigDeclaration(java.lang.String region)
Returns the currently active cache configuration for the supplied region- Parameters:
region-- Returns:
- Returns the currently active cache configuration for the supplied region
-
isTerracottaHibernateCache
boolean isTerracottaHibernateCache(java.lang.String region)
Returns true if the input region is clustered with terracotta- Parameters:
region-- Returns:
- Returns true if the input region is clustered with terracotta
-
getTerracottaHibernateCacheRegionNames
java.lang.String[] getTerracottaHibernateCacheRegionNames()
Returns the region names which are clustered with terracotta- Returns:
- Returns the region names which are clustered with terracotta
-
getRegionCacheAttributes
java.util.Map<java.lang.String,java.lang.Object> getRegionCacheAttributes(java.lang.String regionName)
Returns a map containing attributes of the cache for the input cache region name- Parameters:
regionName-- Returns:
- Returns a map containing attributes of the cache for the input cache region name
-
getRegionCacheAttributes
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getRegionCacheAttributes()
Returns a map containing mapping of all cache region names to their attributes- Returns:
- Returns a map containing mapping of all cache region names to their attributes
-
isRegionCacheEnabled
boolean isRegionCacheEnabled(java.lang.String region)
Returns true if cache is enabled for the input region- Parameters:
region-- Returns:
- Returns true if cache is enabled for the input region
-
setRegionCacheEnabled
void setRegionCacheEnabled(java.lang.String region, boolean enabled)Enables/disables a particular region- Parameters:
region-enabled-
-
isRegionCachesEnabled
boolean isRegionCachesEnabled()
Returns true if all the cache regions are enabled. If even one cache is disabled, it will return false- Returns:
- Returns true if all the cache regions are enabled. If even one cache is disabled, it will return false
-
setRegionCachesEnabled
void setRegionCachesEnabled(boolean enabled)
Enable/disable all the cache regions.
-
getRegionCacheMaxTTISeconds
int getRegionCacheMaxTTISeconds(java.lang.String region)
Returns the time to idle for the input cache region- Parameters:
region-- Returns:
- Returns the time to live for the input cache region
-
setRegionCacheMaxTTISeconds
void setRegionCacheMaxTTISeconds(java.lang.String region, int maxTTISeconds)Sets the time to idle for the input cache region- Parameters:
region-maxTTISeconds- Returns the time to idle for the input cache region
-
getRegionCacheMaxTTLSeconds
int getRegionCacheMaxTTLSeconds(java.lang.String region)
Returns the time to live for the input cache region- Parameters:
region-- Returns:
- Returns the time to live for the input cache region
-
setRegionCacheMaxTTLSeconds
void setRegionCacheMaxTTLSeconds(java.lang.String region, int maxTTLSeconds)Sets the time to live for the input cache region- Parameters:
region-maxTTLSeconds-
-
getRegionCacheTargetMaxInMemoryCount
int getRegionCacheTargetMaxInMemoryCount(java.lang.String region)
Returns the maxElementsInMemory of the input cache region- Parameters:
region-- Returns:
- Returns the maxElementsInMemory of the input cache region
-
setRegionCacheTargetMaxInMemoryCount
void setRegionCacheTargetMaxInMemoryCount(java.lang.String region, int targetMaxInMemoryCount)Sets the maxElementsInMemory of the input cache region- Parameters:
region-targetMaxInMemoryCount-
-
getRegionCacheTargetMaxTotalCount
int getRegionCacheTargetMaxTotalCount(java.lang.String region)
Returns the maxElementsOnDisk of the input cache region- Parameters:
region-- Returns:
- Returns the maxElementsOnDisk of the input cache region
-
setRegionCacheTargetMaxTotalCount
void setRegionCacheTargetMaxTotalCount(java.lang.String region, int targetMaxTotalCount)Sets the maxElementsOnDisk of the input cache region- Parameters:
region-targetMaxTotalCount-
-
isRegionCacheLoggingEnabled
boolean isRegionCacheLoggingEnabled(java.lang.String region)
Returns true if logging is enabled for the input cache region- Parameters:
region-- Returns:
- Returns true if logging is enabled for the input cache region
-
setRegionCacheLoggingEnabled
void setRegionCacheLoggingEnabled(java.lang.String region, boolean loggingEnabled)Enable/Disable logging for the input cache region- Parameters:
region-loggingEnabled-
-
isRegionCacheOrphanEvictionEnabled
boolean isRegionCacheOrphanEvictionEnabled(java.lang.String region)
Returns true if orphan eviction is enabled for the region otherwise false- Parameters:
region-- Returns:
- Returns true if orphan eviction is enabled for the region otherwise false
-
getRegionCacheOrphanEvictionPeriod
int getRegionCacheOrphanEvictionPeriod(java.lang.String region)
Returns the orphan eviction period for the input cache region.- Parameters:
region-- Returns:
- Returns the orphan eviction period for the input cache region.
-
flushRegionCache
void flushRegionCache(java.lang.String region)
Flushes the cache for the input region- Parameters:
region-
-
flushRegionCaches
void flushRegionCaches()
Flushes all the caches for all the regions
-
getCacheHitCount
long getCacheHitCount()
Returns hit count for all the caches- Returns:
- Returns hit count for all the caches
-
getCacheHitSample
long getCacheHitSample()
Returns hit count sample for all the caches- Returns:
- Returns hit count sample for all the caches
-
getCacheHitRate
double getCacheHitRate()
Returns hit rate for all the caches- Returns:
- Returns hit rate for all the caches
-
getCacheMissCount
long getCacheMissCount()
Returns miss count for all the caches- Returns:
- Returns miss count for all the caches
-
getCacheMissSample
long getCacheMissSample()
Returns miss count sample for all the caches- Returns:
- Returns miss count sample for all the caches
-
getCacheMissRate
double getCacheMissRate()
Returns miss rate for all the caches- Returns:
- Returns miss rate for all the caches
-
getCachePutSample
long getCachePutSample()
Returns put count sample for all the caches- Returns:
- Returns put count sample for all the caches
-
getCachePutCount
long getCachePutCount()
Returns put count for all the caches- Returns:
- Returns put count for all the caches
-
getCachePutRate
double getCachePutRate()
Returns put rate for all the caches- Returns:
- Returns put rate for all the caches
-
getRegionCacheSamples
java.util.Map<java.lang.String,int[]> getRegionCacheSamples()
Returns a map containing mapping between cache names and an array containing hit, miss and put count samples- Returns:
- Returns a map containing mapping between cache names and an array containing hit, miss and put count samples
-
getNumberOfElementsInMemory
int getNumberOfElementsInMemory(java.lang.String region)
Returns number of elements in-memory in the cache for the input region- Parameters:
region-- Returns:
- Returns number of elements in-memory in the cache for the input region
-
getNumberOfElementsOffHeap
int getNumberOfElementsOffHeap(java.lang.String region)
Returns number of elements off-heap in the cache for the input region- Parameters:
region-- Returns:
- Returns number of elements off-heap in the cache for the input region
-
getNumberOfElementsOnDisk
int getNumberOfElementsOnDisk(java.lang.String region)
Returns number of elements on-disk in the cache for the input region- Parameters:
region-- Returns:
- Returns number of elements on-disk in the cache for the input region
-
getMinGetTimeMillis
long getMinGetTimeMillis()
Return minimum time taken for a get operation in the cache in milliseconds- Returns:
- minimum time taken for a get operation in the cache in milliseconds
-
getMaxGetTimeMillis
long getMaxGetTimeMillis()
Return maximum time taken in milliseconds for a get operation- Returns:
- Return maximum time taken in milliseconds for a get operation
-
getAverageGetTimeMillis
float getAverageGetTimeMillis(java.lang.String region)
Return average time taken in milliseconds for a get operation for the input cache name- Returns:
- Return average time taken in milliseconds for a get operation for the input cache name
-
getMinGetTimeMillis
long getMinGetTimeMillis(java.lang.String cacheName)
Return minimum time taken in milliseconds for a get operation for the input cache name- Returns:
- Return minimum time taken in milliseconds for a get operation for the input cache name
-
getMaxGetTimeMillis
long getMaxGetTimeMillis(java.lang.String cacheName)
Return maximum time taken in milliseconds for a get operation for the input cache name- Returns:
- Return maximum time taken in milliseconds for a get operation for the input cache name
-
-