Transfer version 1.1

transfer.com.cache
Class CacheMonitor

WEB-INF.cftags.component
        extended by transfer.com.cache.CacheMonitor

public class CacheMonitor
extends WEB-INF.cftags.component

The cache monitor class for introspection and statistics on caching


Constructor Summary
init(FacadeFactory facadeFactory, CacheConfigManager cacheConfigManager)
          Constructor
 
Method Summary
private void eachCacheManager(any function, [struct args='[runtime expression]'])
          HOF that runs a function against each facade's ConfigManager, if it has one
package void evict(string className)
          adds ane extra counter to the cache eviction count
private void executeGetCachedClasses(any cacheManager, array classArray)
          adds the keyset from the cached classes to the array in the arguments
private CacheConfigManager getCacheConfigManager()
 struct getCacheSettings(string className)
          gets the cache settings for a class, as a struct
 array getCachedClasses()
          returns all the cached classes
 numeric getCalculatedSize(string className)
          A slow look at how many items are in cache, where a copy of the cache is taken, and inspected item by item.
 numeric getEstimatedSize(string className)
          A fast lookup of how many items in the cache, simply by checking its size, which may not be exactly accurate
private struct getEvictMap()
 numeric getEvictions(string className)
          get the total number of cache evictions for this class
private FacadeFactory getFacadeFactory()
private struct getHitMap()
 numeric getHitMissRatio(string className)
          returns the ratio of hits vs misses. Values above 1 mean that more hits are occuring than misses.
 numeric getHits(string className)
          returns the number of hits for that class
private numeric getMapValue(struct map, string className)
          returns a map value, if it exists, otherwise, returns 0
private struct getMissMap()
 numeric getMisses(string className)
          returns the number of misses for that class
 numeric getTotalCalculatedSize()
          get the calculated size for all classes
 numeric getTotalEstimatedSize()
          get the estimated size for all classes
 numeric getTotalEvictions()
          get the total number of cache evictions
 numeric getTotalHitMissRatio()
          returns the ratio of total hits vs total misses. Values above 1 mean that more hits are occurring more than misses.
 numeric getTotalHits()
          get the total number of hits
 numeric getTotalMisses()
          get the total number of hits
private struct getValueMap(struct map, string className, string operation)
          returns default values for a value map
package void hit(string className)
          add an extra count to this cache's value being found successfully
private void invokeFacadeCacheManager(AbstractBaseFacade facade, any function, struct args)
          invokes the function against the cache manager if the facade has one
package void miss(string className)
          add an extra count to this cache's value not being found
 void resetEvictions()
          resets eviction counters back to 0
 void resetHitsAndMisses()
          resets the Hit and MIss counters back to 0
private void setCacheConfigManager(CacheConfigManager CacheConfigManager)
private void setEvictMap(struct evictMap)
private void setFacadeFactory(FacadeFactory FacadeFactory)
private void setHitMap(struct HitMap)
private void setMissMap(struct MissMap)
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(FacadeFactory facadeFactory, CacheConfigManager cacheConfigManager)
Constructor

Parameters:
facadeFactory - The facade factory to access caches
cacheConfigManager - The cache config manager
Method Detail

eachCacheManager

private void eachCacheManager(any function, [struct args='[runtime expression]'])
HOF that runs a function against each facade's ConfigManager, if it has one

Parameters:
function - the function to call on the CacheManager
args - the argument data to pass from function call to function call

evict

package void evict(string className)
adds ane extra counter to the cache eviction count

Parameters:
className - the className being evicted

executeGetCachedClasses

private void executeGetCachedClasses(any cacheManager, array classArray)
adds the keyset from the cached classes to the array in the arguments

Parameters:
cacheManager - the java cache manager
classArray - the array of classes

getCacheConfigManager

private CacheConfigManager getCacheConfigManager()


getCacheSettings

public struct getCacheSettings(string className)
gets the cache settings for a class, as a struct

Parameters:
className - the name of the class

getCachedClasses

public array getCachedClasses()
returns all the cached classes


getCalculatedSize

public numeric getCalculatedSize(string className)
A slow look at how many items are in cache, where a copy of the cache is taken, and inspected item by item.

Parameters:
className - the name of the class

getEstimatedSize

public numeric getEstimatedSize(string className)
A fast lookup of how many items in the cache, simply by checking its size, which may not be exactly accurate

Parameters:
className - the name of the class

getEvictMap

private struct getEvictMap()


getEvictions

public numeric getEvictions(string className)
get the total number of cache evictions for this class

Parameters:
className - the class to retrive hits for

getFacadeFactory

private FacadeFactory getFacadeFactory()


getHitMap

private struct getHitMap()


getHitMissRatio

public numeric getHitMissRatio(string className)
returns the ratio of hits vs misses. Values above 1 mean that more hits are occuring than misses.

Parameters:
className - the name of the class to get the ratio for

getHits

public numeric getHits(string className)
returns the number of hits for that class

Parameters:
className - the class to retrive hits for

getMapValue

private numeric getMapValue(struct map, string className)
returns a map value, if it exists, otherwise, returns 0

Parameters:
map - the map to search for
className - the className being retrieved

getMissMap

private struct getMissMap()


getMisses

public numeric getMisses(string className)
returns the number of misses for that class

Parameters:
className - the class to retrive hits for

getTotalCalculatedSize

public numeric getTotalCalculatedSize()
get the calculated size for all classes


getTotalEstimatedSize

public numeric getTotalEstimatedSize()
get the estimated size for all classes


getTotalEvictions

public numeric getTotalEvictions()
get the total number of cache evictions


getTotalHitMissRatio

public numeric getTotalHitMissRatio()
returns the ratio of total hits vs total misses. Values above 1 mean that more hits are occurring more than misses.


getTotalHits

public numeric getTotalHits()
get the total number of hits


getTotalMisses

public numeric getTotalMisses()
get the total number of hits


getValueMap

private struct getValueMap(struct map, string className, string operation)
returns default values for a value map

Parameters:
map - the structure being returned
className - the className being retrieved
operation - the name of the operation

hit

package void hit(string className)
add an extra count to this cache's value being found successfully

Parameters:
className - the className being hit

invokeFacadeCacheManager

private void invokeFacadeCacheManager(AbstractBaseFacade facade, any function, struct args)
invokes the function against the cache manager if the facade has one

Parameters:
facade - the facade to call against
function - the function to call on the CacheManager
args - the argument data to pass from function call to function call

miss

package void miss(string className)
add an extra count to this cache's value not being found

Parameters:
className - the className being missed

resetEvictions

public void resetEvictions()
resets eviction counters back to 0


resetHitsAndMisses

public void resetHitsAndMisses()
resets the Hit and MIss counters back to 0


setCacheConfigManager

private void setCacheConfigManager(CacheConfigManager CacheConfigManager)

Parameters:
CacheConfigManager

setEvictMap

private void setEvictMap(struct evictMap)

Parameters:
evictMap

setFacadeFactory

private void setFacadeFactory(FacadeFactory FacadeFactory)

Parameters:
FacadeFactory

setHitMap

private void setHitMap(struct HitMap)

Parameters:
HitMap

setMissMap

private void setMissMap(struct MissMap)

Parameters:
MissMap

Transfer version 1.1