public class RedisMetricRepository extends Object implements MetricRepository
MetricRepository
implementation for a redis backend. Metric values are stored
as regular hash values against a key composed of the metric name prefixed with a
constant (default "spring.metrics.").Constructor and Description |
---|
RedisMetricRepository(RedisConnectionFactory redisConnectionFactory) |
public RedisMetricRepository(RedisConnectionFactory redisConnectionFactory)
public void setPrefix(String prefix)
prefix
- the prefix to set for all metrics keyspublic Metric<?> findOne(String metricName)
findOne
in interface MetricReader
public Iterable<Metric<?>> findAll()
findAll
in interface MetricReader
public long count()
count
in interface MetricReader
public void increment(Delta<?> delta)
increment
in interface MetricWriter
public void set(Metric<?> value)
set
in interface MetricWriter
public void reset(String metricName)
reset
in interface MetricWriter
Copyright © 2014. All rights reserved.