public class InMemoryRichGaugeRepository extends Object implements RichGaugeRepository
MetricWriter and RichGaugeReader. When you
set a metric value (using MetricWriter.set(Metric)) it is used to update a rich
gauge (increment is a no-op). Gauge values can then be read out using the reader
operations.| Constructor and Description |
|---|
InMemoryRichGaugeRepository() |
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
Iterable<RichGauge> |
findAll()
Find all instances of rich gauge known to this reader.
|
RichGauge |
findOne(String metricName)
Find a single instance of a rich gauge by name.
|
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<?> metric)
Set the value of a metric.
|
public void increment(Delta<?> delta)
MetricWriterincrement in interface MetricWriterdelta - the amount to increment bypublic void set(Metric<?> metric)
MetricWriterset in interface MetricWritermetric - the valuepublic void reset(String metricName)
MetricWriterreset in interface MetricWritermetricName - the name to resetpublic RichGauge findOne(String metricName)
RichGaugeReaderfindOne in interface RichGaugeReadermetricName - the name of the gaugepublic Iterable<RichGauge> findAll()
RichGaugeReaderfindAll in interface RichGaugeReaderpublic long count()
count in interface RichGaugeReaderCopyright © 2015 Pivotal Software, Inc.. All rights reserved.