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)
MetricWriter
increment
in interface MetricWriter
delta
- the amount to increment bypublic void set(Metric<?> metric)
MetricWriter
set
in interface MetricWriter
public void reset(String metricName)
MetricWriter
reset
in interface MetricWriter
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()
count
in interface RichGaugeReader
Copyright © 2014. All rights reserved.