public class InMemoryRichGaugeRepository extends Object implements RichGaugeRepository
MetricWriter
and RichGaugeReader
. When you
set
or increment
a metric value it is used to update a RichGauge
. Gauge values can then be read
out using the reader operations.Constructor and Description |
---|
InMemoryRichGaugeRepository() |
Modifier and Type | Method and Description |
---|---|
long |
count()
Return the number of gauge values available.
|
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)
CounterWriter
increment
in interface CounterWriter
delta
- the amount to increment bypublic void set(Metric<?> metric)
GaugeWriter
set
in interface GaugeWriter
metric
- the valuepublic void reset(String metricName)
CounterWriter
reset
in interface CounterWriter
metricName
- the name to resetpublic RichGauge findOne(String metricName)
RichGaugeReader
findOne
in interface RichGaugeReader
metricName
- the name of the gaugepublic Iterable<RichGauge> findAll()
RichGaugeReader
findAll
in interface RichGaugeReader
public long count()
RichGaugeReader
count
in interface RichGaugeReader
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.