public final class RedisRichGaugeRepository extends java.lang.Object implements RichGaugeRepository
Constructor and Description |
---|
RedisRichGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) |
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 and reset any accumulated average, max and min values
|
<S extends M> |
save(java.lang.Iterable<S> metrics) |
<S extends M> |
save(S metric) |
void |
setAlpha(java.lang.String name,
double value)
Sets the "smoothing constant", "alpha" for use in calculating an exponential moving average for the
gauge.
|
void |
setValue(java.lang.String name,
double value)
Sets the current value of the gauge.
|
public RedisRichGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
public void setValue(java.lang.String name, double value)
RichGaugeRepository
setValue
in interface RichGaugeRepository
name
- the gauge namevalue
- the value of the gaugepublic void setAlpha(java.lang.String name, double value)
RichGaugeRepository
The parameter can be set at any time after the gauge has been created. The mean calculated up to that point will be used to initialize the moving average from that point on.
setAlpha
in interface RichGaugeRepository
name
- the gauge namevalue
- the value of the gaugepublic void reset(java.lang.String name)
RichGaugeRepository
reset
in interface RichGaugeRepository
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)