public class InMemoryMetricRepository extends Object implements MetricRepository
MetricRepository implementation that stores metrics in memory.| Constructor and Description |
|---|
InMemoryMetricRepository() |
| Modifier and Type | Method and Description |
|---|---|
long |
count()
The number of metrics known to this reader.
|
Iterable<Metric<?>> |
findAll()
Find all the metrics known to this reader.
|
Iterable<Metric<?>> |
findAllWithPrefix(String prefix) |
Metric<?> |
findOne(String metricName)
Find an instance of the metric with the given name (usually the latest recorded
value).
|
void |
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).
|
void |
reset(String metricName)
Reset the value of a metric, usually to zero value.
|
void |
set(Metric<?> value)
Set the value of a metric.
|
void |
setValues(ConcurrentNavigableMap<String,Metric<?>> values) |
public void setValues(ConcurrentNavigableMap<String,Metric<?>> values)
public void increment(Delta<?> delta)
CounterWriterincrement in interface CounterWriterdelta - the amount to increment bypublic void set(Metric<?> value)
GaugeWriterset in interface GaugeWritervalue - the valuepublic long count()
MetricReadercount in interface MetricReaderpublic void reset(String metricName)
CounterWriterreset in interface CounterWritermetricName - the name to resetpublic Metric<?> findOne(String metricName)
MetricReaderfindOne in interface MetricReadermetricName - the name of the metric to findpublic Iterable<Metric<?>> findAll()
MetricReaderfindAll in interface MetricReaderCopyright © 2019 Pivotal Software, Inc.. All rights reserved.