public class InMemoryAggregateCounterRepository extends Object implements AggregateCounterRepository
| Constructor and Description |
|---|
InMemoryAggregateCounterRepository() |
| Modifier and Type | Method and Description |
|---|---|
long |
decrement(String name) |
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 end,
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)
Query function to allow the counts for a specific interval to be retrieved for the given resolution.
|
long |
increment(String name) |
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 name)
Reset the given AggregateCounter.
|
AggregateCounter |
save(AggregateCounter counter) |
public long increment(String name)
public long decrement(String name)
public void reset(String name)
AggregateCounterWriterreset in interface AggregateCounterWritername - the AggregateCounter namepublic 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 eventpublic 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, org.joda.time.Interval interval, AggregateCounterResolution resolution)
AggregateCounterReadergetCounts 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 AggregateCounter findOne(String name)
AggregateCounterReaderfindOne in interface AggregateCounterReadername - the counter to querypublic List<String> list()
AggregateCounterReaderlist in interface AggregateCounterReaderpublic AggregateCounter getCounts(String name, int nCounts, org.joda.time.DateTime end, AggregateCounterResolution resolution)
AggregateCounterReadergetCounts in interface AggregateCounterReadername - the counter to querynCounts - the number of data points to returnend - 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 save(AggregateCounter counter)
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.