public class RedisMultiMetricRepository extends Object implements MultiMetricRepository
MultiMetricRepository implementation backed by a redis store. Metric values are
stored as zset values and the timestamps as regular values, both against a key composed
of the group name prefixed with a constant prefix (default "spring.groups."). The group
names are stored as a zset under "keys." + [prefix].| Constructor and Description |
|---|
RedisMultiMetricRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) |
RedisMultiMetricRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
String prefix) |
| Modifier and Type | Method and Description |
|---|---|
long |
countGroups()
The number of groups available in this repository.
|
Iterable<Metric<?>> |
findAll(String group)
Find all metrics whose name starts with the given prefix.
|
Iterable<String> |
groups()
The names of all the groups known to this repository.
|
void |
increment(String group,
Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).
|
void |
reset(String group)
Rest the values of all metrics in the group.
|
void |
set(String group,
Collection<Metric<?>> values)
Save some metric values and associate them with a group name.
|
public RedisMultiMetricRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory)
public RedisMultiMetricRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
String prefix)
public Iterable<Metric<?>> findAll(String group)
PrefixMetricReaderfindAll in interface PrefixMetricReadergroup - the prefix for metric namespublic void set(String group, Collection<Metric<?>> values)
PrefixMetricWriterset in interface PrefixMetricWritergroup - the name of the groupvalues - the metric values to savepublic void increment(String group, Delta<?> delta)
PrefixMetricWritergroup + "." + delta.name.increment in interface PrefixMetricWritergroup - the name of the groupdelta - the amount to increment bypublic Iterable<String> groups()
MultiMetricRepositorygroups in interface MultiMetricRepositorypublic long countGroups()
MultiMetricRepositorycountGroups in interface MultiMetricRepositorypublic void reset(String group)
PrefixMetricWriterreset in interface PrefixMetricWritergroup - reset the whole groupCopyright © 2015 Pivotal Software, Inc.. All rights reserved.