Package org.nuxeo.ecm.core.cache
Class CacheMetrics
- java.lang.Object
-
- org.nuxeo.ecm.core.cache.CacheWrapper
-
- org.nuxeo.ecm.core.cache.CacheMetrics
-
- All Implemented Interfaces:
Cache,CacheManagement
public class CacheMetrics extends CacheWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected io.dropwizard.metrics5.MetricNameINVALIDATE_ALL_NAMEprotected io.dropwizard.metrics5.Counterinvalidationprotected io.dropwizard.metrics5.Counterreadprotected io.dropwizard.metrics5.Counterread_hitprotected io.dropwizard.metrics5.MetricNameREAD_HIT_NAMEprotected io.dropwizard.metrics5.RatioGaugeread_hit_ratioprotected io.dropwizard.metrics5.MetricNameREAD_HIT_RATIO_NAMEprotected io.dropwizard.metrics5.Counterread_missprotected io.dropwizard.metrics5.MetricNameREAD_MISS_NAMEprotected io.dropwizard.metrics5.MetricNameREAD_NAMEprotected io.dropwizard.metrics5.MetricRegistryregistryprotected io.dropwizard.metrics5.Gauge<Long>sizeprotected io.dropwizard.metrics5.MetricNameSIZE_NAMEprotected io.dropwizard.metrics5.Counterwriteprotected io.dropwizard.metrics5.MetricNameWRITE_NAME-
Fields inherited from class org.nuxeo.ecm.core.cache.CacheWrapper
cache
-
-
Constructor Summary
Constructors Constructor Description CacheMetrics(CacheManagement cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializableget(String key)Get method to retrieve value from cache Must not raise exception if the key is null, but return nullvoidinvalidateAll()Invalidate all key-value stored in the cacheprotected io.dropwizard.metrics5.MetricNamenameOf(String name)voidput(String key, Serializable value)Put method to store aSerializablevaluevoidstart()Starts this cache.voidstop()Stops this cache and releases related resources.-
Methods inherited from class org.nuxeo.ecm.core.cache.CacheWrapper
getName, getSize, hasEntry, invalidate, invalidateLocal, invalidateLocalAll, keySet, putLocal, toString
-
-
-
-
Field Detail
-
registry
protected io.dropwizard.metrics5.MetricRegistry registry
-
read
protected io.dropwizard.metrics5.Counter read
-
read_hit
protected io.dropwizard.metrics5.Counter read_hit
-
read_miss
protected io.dropwizard.metrics5.Counter read_miss
-
read_hit_ratio
protected io.dropwizard.metrics5.RatioGauge read_hit_ratio
-
write
protected io.dropwizard.metrics5.Counter write
-
invalidation
protected io.dropwizard.metrics5.Counter invalidation
-
READ_HIT_NAME
protected final io.dropwizard.metrics5.MetricName READ_HIT_NAME
-
READ_HIT_RATIO_NAME
protected final io.dropwizard.metrics5.MetricName READ_HIT_RATIO_NAME
-
READ_MISS_NAME
protected final io.dropwizard.metrics5.MetricName READ_MISS_NAME
-
READ_NAME
protected final io.dropwizard.metrics5.MetricName READ_NAME
-
WRITE_NAME
protected final io.dropwizard.metrics5.MetricName WRITE_NAME
-
INVALIDATE_ALL_NAME
protected final io.dropwizard.metrics5.MetricName INVALIDATE_ALL_NAME
-
SIZE_NAME
protected final io.dropwizard.metrics5.MetricName SIZE_NAME
-
-
Constructor Detail
-
CacheMetrics
public CacheMetrics(CacheManagement cache)
-
-
Method Detail
-
start
public void start()
Description copied from interface:CacheManagementStarts this cache.- Specified by:
startin interfaceCacheManagement- Overrides:
startin classCacheWrapper
-
stop
public void stop()
Description copied from interface:CacheManagementStops this cache and releases related resources.- Specified by:
stopin interfaceCacheManagement- Overrides:
stopin classCacheWrapper
-
get
public Serializable get(String key)
Description copied from interface:CacheGet method to retrieve value from cache Must not raise exception if the key is null, but return null- Specified by:
getin interfaceCache- Overrides:
getin classCacheWrapper- Parameters:
key- the string key- Returns:
- the
Serializablevalue, return null if the key does not exist or if the key is null
-
put
public void put(String key, Serializable value)
Description copied from interface:CachePut method to store aSerializablevalue- Specified by:
putin interfaceCache- Overrides:
putin classCacheWrapper- Parameters:
key- the string key, if null, the value will not be storedvalue- the value to store, if null, the value will not be stored
-
invalidateAll
public void invalidateAll()
Description copied from interface:CacheInvalidate all key-value stored in the cache- Specified by:
invalidateAllin interfaceCache- Overrides:
invalidateAllin classCacheWrapper
-
-