public class RedisRichGaugeRepository extends java.lang.Object implements RichGaugeRepository
Constructor and Description |
---|
RedisRichGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.retry.RetryOperations retryOperations) |
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 |
recordValue(java.lang.String name,
double value,
double alpha)
Set the current value of the gauge, smoothing accumulated values with the provided alpha value.
|
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 |
setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate) |
public RedisRichGaugeRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, org.springframework.retry.RetryOperations retryOperations)
public void recordValue(java.lang.String name, double value, double alpha)
RichGaugeRepository
recordValue
in interface RichGaugeRepository
name
- the gauge namevalue
- the value of the gaugealpha
- the smoothing factor to usepublic void setRetryTemplate(org.springframework.retry.support.RetryTemplate retryTemplate)
public 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)