public class CacheMetrics extends CacheWrapper
| Modifier and Type | Field and Description |
|---|---|
protected String |
INVALIDATE_ALL_NAME |
protected com.codahale.metrics.Counter |
invalidation |
protected com.codahale.metrics.Counter |
read |
protected com.codahale.metrics.Counter |
read_hit |
protected String |
READ_HIT_NAME |
protected com.codahale.metrics.RatioGauge |
read_hit_ratio |
protected String |
READ_HIT_RATIO_NAME |
protected com.codahale.metrics.Counter |
read_miss |
protected String |
READ_MISS_NAME |
protected String |
READ_NAME |
protected com.codahale.metrics.MetricRegistry |
registry |
protected com.codahale.metrics.Gauge<Long> |
size |
protected String |
SIZE_NAME |
protected com.codahale.metrics.Counter |
write |
protected String |
WRITE_NAME |
cache| Constructor and Description |
|---|
CacheMetrics(CacheManagement cache) |
| Modifier and Type | Method and Description |
|---|---|
Serializable |
get(String key)
Get method to retrieve value from cache Must not raise exception if the key is null, but return null
|
void |
invalidateAll()
Invalidate all key-value stored in the cache
|
protected String |
nameOf(String name) |
void |
put(String key,
Serializable value)
Put method to store a
Serializable value |
void |
start()
Starts this cache.
|
void |
stop()
Stops this cache and releases related resources.
|
getName, getSize, hasEntry, invalidate, invalidateLocal, invalidateLocalAll, keySet, putLocal, toStringprotected com.codahale.metrics.MetricRegistry registry
protected com.codahale.metrics.Counter read
protected com.codahale.metrics.Counter read_hit
protected com.codahale.metrics.Counter read_miss
protected com.codahale.metrics.RatioGauge read_hit_ratio
protected com.codahale.metrics.Counter write
protected com.codahale.metrics.Counter invalidation
protected final String READ_HIT_NAME
protected final String READ_HIT_RATIO_NAME
protected final String READ_MISS_NAME
protected final String WRITE_NAME
protected final String INVALIDATE_ALL_NAME
public CacheMetrics(CacheManagement cache)
public void start()
CacheManagementstart in interface CacheManagementstart in class CacheWrapperpublic void stop()
CacheManagementstop in interface CacheManagementstop in class CacheWrapperpublic Serializable get(String key)
Cacheget in interface Cacheget in class CacheWrapperkey - the string keySerializable value, return null if the key does not exist or if the key is nullpublic void put(String key, Serializable value)
CacheSerializable valueput in interface Cacheput in class CacheWrapperkey - the string key, if null, the value will not be storedvalue - the value to store, if null, the value will not be storedpublic void invalidateAll()
CacheinvalidateAll in interface CacheinvalidateAll in class CacheWrapperCopyright © 2019 Nuxeo. All rights reserved.