public final class RedisRichGaugeRepository extends java.lang.Object implements RichGaugeRepository
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
metricPrefix |
protected org.springframework.data.redis.core.RedisOperations<java.lang.String,V> |
redisOperations |
protected org.springframework.data.redis.core.ValueOperations<java.lang.String,V> |
valueOperations |
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.
|
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.
|
protected final java.lang.String metricPrefix
protected final org.springframework.data.redis.core.ValueOperations<java.lang.String,V> valueOperations
protected final org.springframework.data.redis.core.RedisOperations<java.lang.String,V> redisOperations
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 void deleteAll()
deleteAll
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
protected java.lang.String getMetricKey(java.lang.String metricName)
metricName
- the name of the metricpublic <S extends M> S save(S metric)
save
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public <S extends M> java.lang.Iterable<S> save(java.lang.Iterable<S> metrics)
save
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public void delete(java.lang.String name)
delete
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public void delete(M metric)
delete
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public void delete(java.lang.Iterable<? extends M> metrics)
delete
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public M findOne(java.lang.String name)
findOne
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public boolean exists(java.lang.String s)
exists
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public java.util.List<M> findAll()
findAll
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public java.lang.Iterable<M> findAll(java.lang.Iterable<java.lang.String> keys)
findAll
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>
public long count()
count
in interface org.springframework.data.repository.CrudRepository<M extends Metric,java.lang.String>