public class RedisGaugeRepository extends java.lang.Object implements GaugeRepository
Constructor and Description |
---|
RedisGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) |
RedisGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String gaugePrefix) |
Modifier and Type | Method and Description |
---|---|
long |
count() |
void |
delete(java.lang.Iterable<? extends M> metrics) |
void |
delete(M metric) |
void |
delete(java.lang.String name) |
void |
deleteAll() |
boolean |
exists(java.lang.String s) |
java.util.List<M> |
findAll() |
java.lang.Iterable<M> |
findAll(java.lang.Iterable<java.lang.String> keys) |
M |
findOne(java.lang.String name) |
protected java.lang.String |
getMetricKey(java.lang.String metricName)
Provides the key for a named metric.
|
org.springframework.data.redis.core.RedisOperations<java.lang.String,V> |
getRedisOperations() |
org.springframework.data.redis.core.ValueOperations<java.lang.String,V> |
getValueOperations() |
void |
reset(java.lang.String name)
Reset the gauge to zero
|
<S extends M> |
save(java.lang.Iterable<S> metrics) |
<S extends M> |
save(S metric) |
void |
setValue(java.lang.String name,
long value)
Set the value of the gauge
|
public RedisGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
public RedisGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, java.lang.String gaugePrefix)
public void setValue(java.lang.String name, long value)
GaugeRepository
setValue
in interface GaugeRepository
name
- the gauge namevalue
- the value of the gaugepublic void reset(java.lang.String name)
GaugeRepository
reset
in interface GaugeRepository
name
- the gauge namepublic org.springframework.data.redis.core.ValueOperations<java.lang.String,V> getValueOperations()
public org.springframework.data.redis.core.RedisOperations<java.lang.String,V> getRedisOperations()
public void deleteAll()
protected java.lang.String getMetricKey(java.lang.String metricName)
metricName
- the name of the metricpublic <S extends M> S save(S metric)
public <S extends M> java.lang.Iterable<S> save(java.lang.Iterable<S> metrics)
public void delete(java.lang.String name)
public void delete(M metric)
public void delete(java.lang.Iterable<? extends M> metrics)
public M findOne(java.lang.String name)
public boolean exists(java.lang.String s)
public java.util.List<M> findAll()
public java.lang.Iterable<M> findAll(java.lang.Iterable<java.lang.String> keys)