Class RichGaugeExporter
- java.lang.Object
- org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
- org.springframework.boot.actuate.metrics.export.RichGaugeExporter
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,Exporter
public class RichGaugeExporter extends AbstractMetricExporter
Exporter or converter forRichGauge
data to a metric-based back end. Each gauge measurement is stored as a set of related metrics with a common prefix (the name of the gauge), and suffixes that describe the data. For example, a gauge calledfoo
is stored as[foo.min, foo.max. foo.val, foo.count, foo.avg, foo.alpha]
. If theMetricWriter
provided is aMultiMetricRepository
then the values for a gauge will be stored as a group, and hence will be retrievable from the repository in a single query (or optionally individually).- Since:
- 1.3.0
Constructor Summary
Constructors Constructor Description RichGaugeExporter(RichGaugeReader reader, PrefixMetricWriter writer)
RichGaugeExporter(RichGaugeReader reader, PrefixMetricWriter writer, String prefix)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterable<String>
groups()
Generate a group of metrics to iterate over in the form of a set of Strings (e.g.protected Iterable<Metric<?>>
next(String group)
Get the next group of metrics to write.protected void
write(String group, Collection<Metric<?>> values)
Write the values associated with a group.Methods inherited from class org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
close, export, flush, setEarliestTimestamp, setIgnoreTimestamps, setSendLatest
Constructor Detail
RichGaugeExporter
public RichGaugeExporter(RichGaugeReader reader, PrefixMetricWriter writer)
RichGaugeExporter
public RichGaugeExporter(RichGaugeReader reader, PrefixMetricWriter writer, String prefix)
Method Detail
next
protected Iterable<Metric<?>> next(String group)
Description copied from class:AbstractMetricExporter
Get the next group of metrics to write.- Specified by:
next
in classAbstractMetricExporter
- Parameters:
group
- the group name to write- Returns:
- some metrics to write
groups
protected Iterable<String> groups()
Description copied from class:AbstractMetricExporter
Generate a group of metrics to iterate over in the form of a set of Strings (e.g. prefixes). If the metrics to be exported partition into groups identified by a String, subclasses should override this method. Otherwise the default should be fine (iteration over all metrics).- Overrides:
groups
in classAbstractMetricExporter
- Returns:
- groups of metrics to iterate over (default singleton empty string)
write
protected void write(String group, Collection<Metric<?>> values)
Description copied from class:AbstractMetricExporter
Write the values associated with a group.- Specified by:
write
in classAbstractMetricExporter
- Parameters:
group
- the group to writevalues
- the values to write