ehcache

net.sf.ehcache.hibernate.management.api
Interface EhcacheStats

All Superinterfaces:
NotificationBroadcaster, NotificationEmitter
All Known Subinterfaces:
EhcacheHibernateMBean
All Known Implementing Classes:
EhcacheHibernate, EhcacheStatsImpl

public interface EhcacheStats
extends NotificationEmitter

Interface for ehcache related statistics of hibernate second level cache

Author:
Abhishek Sanoujam

Field Summary
static String CACHE_ENABLED
          CACHE_ENABLED
static String CACHE_FLUSHED
          CACHE_FLUSHED
static String CACHE_REGION_CHANGED
          CACHE_REGION_CHANGED
static String CACHE_REGION_FLUSHED
          CACHE_REGION_FLUSHED
static String CACHE_STATISTICS_ENABLED
          CACHE_STATISTICS_ENABLED
static String CACHE_STATISTICS_RESET
          CACHE_STATISTICS_RESET
 
Method Summary
 void flushRegionCache(String region)
          Flushes the cache for the input region
 void flushRegionCaches()
          Flushes all the caches for all the regions
 String generateActiveConfigDeclaration()
          Returns the currently active cache configuration
 String generateActiveConfigDeclaration(String region)
          Returns the currently active cache configuration for the supplied region
 float getAverageGetTimeMillis(String region)
          Return average time taken in milliseconds for a get operation for the input cache name
 long getCacheHitCount()
          Returns hit count for all the caches
 double getCacheHitRate()
          Returns hit rate for all the caches
 long getCacheHitSample()
          Returns hit count sample for all the caches
 long getCacheMissCount()
          Returns miss count for all the caches
 double getCacheMissRate()
          Returns miss rate for all the caches
 long getCacheMissSample()
          Returns miss count sample for all the caches
 long getCachePutCount()
          Returns put count for all the caches
 double getCachePutRate()
          Returns put rate for all the caches
 long getCachePutSample()
          Returns put count sample for all the caches
 long getMaxGetTimeMillis()
          Return maximum time taken in milliseconds for a get operation
 long getMaxGetTimeMillis(String cacheName)
          Return maximum time taken in milliseconds for a get operation for the input cache name
 long getMinGetTimeMillis()
          Return minimum time taken for a get operation in the cache in milliseconds
 long getMinGetTimeMillis(String cacheName)
          Return minimum time taken in milliseconds for a get operation for the input cache name
 int getNumberOfElementsInMemory(String region)
          Returns number of elements in-memory in the cache for the input region
 int getNumberOfElementsOffHeap(String region)
          Returns number of elements off-heap in the cache for the input region
 int getNumberOfElementsOnDisk(String region)
          Returns number of elements on-disk in the cache for the input region
 String getOriginalConfigDeclaration()
          Get the original cache configuration
 String getOriginalConfigDeclaration(String region)
          Returns the original cache configuration for the supplied region
 Map<String,Map<String,Object>> getRegionCacheAttributes()
          Returns a map containing mapping of all cache region names to their attributes
 Map<String,Object> getRegionCacheAttributes(String regionName)
          Returns a map containing attributes of the cache for the input cache region name
 int getRegionCacheMaxTTISeconds(String region)
          Returns the time to idle for the input cache region
 int getRegionCacheMaxTTLSeconds(String region)
          Returns the time to live for the input cache region
 int getRegionCacheOrphanEvictionPeriod(String region)
          Returns the orphan eviction period for the input cache region.
 Map<String,int[]> getRegionCacheSamples()
          Returns a map containing mapping between cache names and an array containing hit, miss and put count samples
 int getRegionCacheTargetMaxInMemoryCount(String region)
          Returns the maxElementsInMemory of the input cache region
 int getRegionCacheTargetMaxTotalCount(String region)
          Returns the maxElementsOnDisk of the input cache region
 String[] getTerracottaHibernateCacheRegionNames()
          Returns the region names which are clustered with terracotta
 boolean isRegionCacheEnabled(String region)
          Returns true if cache is enabled for the input region
 boolean isRegionCacheLoggingEnabled(String region)
          Returns true if logging is enabled for the input cache region
 boolean isRegionCacheOrphanEvictionEnabled(String region)
          Returns true if orphan eviction is enabled for the region otherwise false
 boolean isRegionCachesEnabled()
          Returns true if all the cache regions are enabled.
 boolean isTerracottaHibernateCache(String region)
          Returns true if the input region is clustered with terracotta
 void setRegionCacheEnabled(String region, boolean enabled)
          Enables/disables a particular region
 void setRegionCacheLoggingEnabled(String region, boolean loggingEnabled)
          Enable/Disable logging for the input cache region
 void setRegionCacheMaxTTISeconds(String region, int maxTTISeconds)
          Sets the time to idle for the input cache region
 void setRegionCacheMaxTTLSeconds(String region, int maxTTLSeconds)
          Sets the time to live for the input cache region
 void setRegionCachesEnabled(boolean enabled)
          Enable/disable all the cache regions.
 void setRegionCacheTargetMaxInMemoryCount(String region, int targetMaxInMemoryCount)
          Sets the maxElementsInMemory of the input cache region
 void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount)
          Sets the maxElementsOnDisk of the input cache region
 
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Field Detail

CACHE_ENABLED

static final String CACHE_ENABLED
CACHE_ENABLED

See Also:
Constant Field Values

CACHE_REGION_CHANGED

static final String CACHE_REGION_CHANGED
CACHE_REGION_CHANGED

See Also:
Constant Field Values

CACHE_FLUSHED

static final String CACHE_FLUSHED
CACHE_FLUSHED

See Also:
Constant Field Values

CACHE_REGION_FLUSHED

static final String CACHE_REGION_FLUSHED
CACHE_REGION_FLUSHED

See Also:
Constant Field Values

CACHE_STATISTICS_ENABLED

static final String CACHE_STATISTICS_ENABLED
CACHE_STATISTICS_ENABLED

See Also:
Constant Field Values

CACHE_STATISTICS_RESET

static final String CACHE_STATISTICS_RESET
CACHE_STATISTICS_RESET

See Also:
Constant Field Values
Method Detail

getOriginalConfigDeclaration

String getOriginalConfigDeclaration()
Get the original cache configuration

Returns:
the original cache configuration

getOriginalConfigDeclaration

String getOriginalConfigDeclaration(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

String generateActiveConfigDeclaration()
Returns the currently active cache configuration

Returns:
the currently active cache configuration

generateActiveConfigDeclaration

String generateActiveConfigDeclaration(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(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

String[] getTerracottaHibernateCacheRegionNames()
Returns the region names which are clustered with terracotta

Returns:
Returns the region names which are clustered with terracotta

getRegionCacheAttributes

Map<String,Object> getRegionCacheAttributes(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

Map<String,Map<String,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(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(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(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(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(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(String region,
                                 int maxTTLSeconds)
Sets the time to live for the input cache region

Parameters:
region -
maxTTLSeconds -

getRegionCacheTargetMaxInMemoryCount

int getRegionCacheTargetMaxInMemoryCount(String region)
Returns the maxElementsInMemory of the input cache region

Parameters:
region -
Returns:
Returns the maxElementsInMemory of the input cache region

setRegionCacheTargetMaxInMemoryCount

void setRegionCacheTargetMaxInMemoryCount(String region,
                                          int targetMaxInMemoryCount)
Sets the maxElementsInMemory of the input cache region

Parameters:
region -
targetMaxInMemoryCount -

getRegionCacheTargetMaxTotalCount

int getRegionCacheTargetMaxTotalCount(String region)
Returns the maxElementsOnDisk of the input cache region

Parameters:
region -
Returns:
Returns the maxElementsOnDisk of the input cache region

setRegionCacheTargetMaxTotalCount

void setRegionCacheTargetMaxTotalCount(String region,
                                       int targetMaxTotalCount)
Sets the maxElementsOnDisk of the input cache region

Parameters:
region -
targetMaxTotalCount -

isRegionCacheLoggingEnabled

boolean isRegionCacheLoggingEnabled(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(String region,
                                  boolean loggingEnabled)
Enable/Disable logging for the input cache region

Parameters:
region -
loggingEnabled -

isRegionCacheOrphanEvictionEnabled

boolean isRegionCacheOrphanEvictionEnabled(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(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(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

Map<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(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(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(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(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(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(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

ehcache

Copyright 2001-2017, Terracotta, Inc.