Package io.dropwizard.metrics5.ehcache
Class InstrumentedEhcache
- java.lang.Object
-
- net.sf.ehcache.constructs.EhcacheDecoratorAdapter
-
- io.dropwizard.metrics5.ehcache.InstrumentedEhcache
-
- All Implemented Interfaces:
Cloneable,net.sf.ehcache.Ehcache,net.sf.ehcache.terracotta.InternalEhcache
public class InstrumentedEhcache extends net.sf.ehcache.constructs.EhcacheDecoratorAdapterAn instrumentedEhcacheinstance.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description net.sf.ehcache.Elementget(Serializable key)net.sf.ehcache.Elementget(Object key)static net.sf.ehcache.Ehcacheinstrument(io.dropwizard.metrics5.MetricRegistry registry, net.sf.ehcache.Ehcache cache)Instruments the givenEhcacheinstance with get and put timers and a set of gauges for Ehcache's built-in statistics:voidput(net.sf.ehcache.Element element)voidput(net.sf.ehcache.Element element, boolean doNotNotifyCacheReplicators)net.sf.ehcache.ElementputIfAbsent(net.sf.ehcache.Element element)-
Methods inherited from class net.sf.ehcache.constructs.EhcacheDecoratorAdapter
acquireReadLockOnKey, acquireWriteLockOnKey, addPropertyChangeListener, bootstrap, calculateInMemorySize, calculateOffHeapSize, calculateOnDiskSize, clone, createQuery, disableDynamicFeatures, dispose, evictExpiredElements, flush, getAll, getAllWithLoader, getBootstrapCacheLoader, getCacheConfiguration, getCacheEventNotificationService, getCacheExceptionHandler, getCacheManager, getDiskStoreSize, getGuid, getInternalContext, getKeys, getKeysNoDuplicateCheck, getKeysWithExpiryCheck, getMemoryStoreSize, getName, getOffHeapStoreSize, getQuiet, getQuiet, getRegisteredCacheExtensions, getRegisteredCacheLoaders, getRegisteredCacheWriter, getSearchAttribute, getSearchAttributes, getSize, getStatistics, getStatus, getWithLoader, getWriterManager, hasAbortedSizeOf, initialise, isClusterBulkLoadEnabled, isClusterCoherent, isDisabled, isElementInMemory, isElementInMemory, isElementOnDisk, isElementOnDisk, isExpired, isKeyInCache, isNodeBulkLoadEnabled, isNodeCoherent, isReadLockedByCurrentThread, isSearchable, isValueInCache, isWriteLockedByCurrentThread, load, loadAll, putAll, putIfAbsent, putQuiet, putWithWriter, recalculateSize, registerCacheExtension, registerCacheLoader, registerCacheWriter, registerDynamicAttributesExtractor, releaseReadLockOnKey, releaseWriteLockOnKey, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAndReturnElement, removeElement, removePropertyChangeListener, removeQuiet, removeQuiet, removeWithWriter, replace, replace, setBootstrapCacheLoader, setCacheExceptionHandler, setCacheManager, setDisabled, setName, setNodeBulkLoadEnabled, setNodeCoherent, setTransactionManagerLookup, toString, tryReadLockOnKey, tryWriteLockOnKey, unregisterCacheExtension, unregisterCacheLoader, unregisterCacheWriter, waitUntilClusterBulkLoadComplete, waitUntilClusterCoherent
-
-
-
-
Method Detail
-
instrument
public static net.sf.ehcache.Ehcache instrument(io.dropwizard.metrics5.MetricRegistry registry, net.sf.ehcache.Ehcache cache)Instruments the givenEhcacheinstance with get and put timers and a set of gauges for Ehcache's built-in statistics:Ehcache timered metrics hitsThe number of times a requested item was found in the cache. in-memory-hitsNumber of times a requested item was found in the memory store. off-heap-hitsNumber of times a requested item was found in the off-heap store. on-disk-hitsNumber of times a requested item was found in the disk store. missesNumber of times a requested item was not found in the cache. in-memory-missesNumber of times a requested item was not found in the memory store. off-heap-missesNumber of times a requested item was not found in the off-heap store. on-disk-missesNumber of times a requested item was not found in the disk store. objectsNumber of elements stored in the cache. in-memory-objectsNumber of objects in the memory store. off-heap-objectsNumber of objects in the off-heap store. on-disk-objectsNumber of objects in the disk store. mean-get-timeThe average get time. Because ehcache support JDK1.4.2, each get time uses System.currentTimeMillis(), rather than nanoseconds. The accuracy is thus limited.mean-search-timeThe average execution time (in milliseconds) within the last sample period. eviction-countThe number of cache evictions, since the cache was created, or statistics were cleared. searches-per-secondThe number of search executions that have completed in the last second. accuracyA human readable description of the accuracy setting. One of "None", "Best Effort" or "Guaranteed". N.B.: This enables Ehcache's sampling statistics with an accuracy level of "none."
- Parameters:
cache- anEhcacheinstanceregistry- aMetricRegistry- Returns:
- an instrumented decorator for
cache - See Also:
StatisticsGateway
-
get
public net.sf.ehcache.Element get(Object key) throws IllegalStateException, net.sf.ehcache.CacheException
- Specified by:
getin interfacenet.sf.ehcache.Ehcache- Overrides:
getin classnet.sf.ehcache.constructs.EhcacheDecoratorAdapter- Throws:
IllegalStateExceptionnet.sf.ehcache.CacheException
-
get
public net.sf.ehcache.Element get(Serializable key) throws IllegalStateException, net.sf.ehcache.CacheException
- Specified by:
getin interfacenet.sf.ehcache.Ehcache- Overrides:
getin classnet.sf.ehcache.constructs.EhcacheDecoratorAdapter- Throws:
IllegalStateExceptionnet.sf.ehcache.CacheException
-
put
public void put(net.sf.ehcache.Element element) throws IllegalArgumentException, IllegalStateException, net.sf.ehcache.CacheException- Specified by:
putin interfacenet.sf.ehcache.Ehcache- Overrides:
putin classnet.sf.ehcache.constructs.EhcacheDecoratorAdapter- Throws:
IllegalArgumentExceptionIllegalStateExceptionnet.sf.ehcache.CacheException
-
put
public void put(net.sf.ehcache.Element element, boolean doNotNotifyCacheReplicators) throws IllegalArgumentException, IllegalStateException, net.sf.ehcache.CacheException- Specified by:
putin interfacenet.sf.ehcache.Ehcache- Overrides:
putin classnet.sf.ehcache.constructs.EhcacheDecoratorAdapter- Throws:
IllegalArgumentExceptionIllegalStateExceptionnet.sf.ehcache.CacheException
-
putIfAbsent
public net.sf.ehcache.Element putIfAbsent(net.sf.ehcache.Element element) throws NullPointerException- Specified by:
putIfAbsentin interfacenet.sf.ehcache.Ehcache- Overrides:
putIfAbsentin classnet.sf.ehcache.constructs.EhcacheDecoratorAdapter- Throws:
NullPointerException
-
-