public class RedisAggregateCounterRepository extends Object implements AggregateCounterRepository
AggregateCounterRepository.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.data.redis.core.HashOperations<String,String,Long> |
hashOperations |
protected org.springframework.data.redis.core.SetOperations<String,String> |
setOperations |
| Constructor and Description |
|---|
RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.retry.RetryOperations retryOperations) |
| Modifier and Type | Method and Description |
|---|---|
AggregateCounter |
findOne(String name)
Retrieve a single counter by name.
|
AggregateCounter |
getCounts(String name,
int nCounts,
AggregateCounterResolution resolution)
Query function which returns the last 'n' points for a particular resolution.
|
AggregateCounter |
getCounts(String name,
int nCounts,
org.joda.time.DateTime endDate,
AggregateCounterResolution resolution)
Queries by requesting a number of points, ending on the given date (inclusive).
|
AggregateCounter |
getCounts(String name,
org.joda.time.Interval interval,
AggregateCounterResolution resolution)
For each query, we need to convert the interval into two variations.
|
protected String |
getMetricKey(String metricName)
Provides the key for a named metric.
|
long |
increment(String name,
long amount,
org.joda.time.DateTime dateTime)
Increments the named counter by a specific amount for the given instant.
|
List<String> |
list()
List the names of all available aggregate counters.
|
void |
reset(String id)
Reset the given AggregateCounter.
|
protected org.springframework.data.redis.core.HashOperations<String,String,Long> hashOperations
public RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.retry.RetryOperations retryOperations)
public long increment(String name, long amount, org.joda.time.DateTime dateTime)
AggregateCounterWriterincrement in interface AggregateCounterWritername - the name of the counteramount - the amount to incrementdateTime - the time of the eventprotected String getMetricKey(String metricName)
metricName - the name of the metricpublic AggregateCounter getCounts(String name, int nCounts, AggregateCounterResolution resolution)
AggregateCounterReadergetCounts in interface AggregateCounterReadername - the counter to querynCounts - the number of data points to returnresolution - the resolution at which the data should be returned (minute, hour, day, month)public AggregateCounter getCounts(String name, int nCounts, org.joda.time.DateTime endDate, AggregateCounterResolution resolution)
AggregateCounterReadergetCounts in interface AggregateCounterReadername - the counter to querynCounts - the number of data points to returnendDate - the end of the query interval (inclusive). Cannot be null.resolution - the resolution at which the data should be returned (minute, hour, day, month)public AggregateCounter getCounts(String name, org.joda.time.Interval interval, AggregateCounterResolution resolution)
getCounts in interface AggregateCounterReadername - the counter to queryinterval - the time interval to return data for. Includes start and end.resolution - the resolution at which the data should be returned (minute, hour, day, month)public List<String> list()
AggregateCounterReaderlist in interface AggregateCounterReaderpublic AggregateCounter findOne(String name)
AggregateCounterReaderfindOne in interface AggregateCounterReadername - the counter to querypublic void reset(String id)
AggregateCounterWriterreset in interface AggregateCounterWriterid - the AggregateCounter nameCopyright © 2016 Pivotal Software, Inc.. All rights reserved.