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, toString
protected 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()
CacheManagement
start
in interface CacheManagement
start
in class CacheWrapper
public void stop()
CacheManagement
stop
in interface CacheManagement
stop
in class CacheWrapper
public Serializable get(String key)
Cache
get
in interface Cache
get
in class CacheWrapper
key
- the string keySerializable
value, return null if the key does not exist or if the key is nullpublic void put(String key, Serializable value)
Cache
Serializable
valueput
in interface Cache
put
in class CacheWrapper
key
- 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()
Cache
invalidateAll
in interface Cache
invalidateAll
in class CacheWrapper
Copyright © 2018 Nuxeo. All rights reserved.