public class PrefixMetricGroupExporter extends AbstractMetricExporter
PrefixMetricReader
. Exports
all metrics whose name starts with a prefix (or all metrics if the prefix is empty).Constructor and Description |
---|
PrefixMetricGroupExporter(PrefixMetricReader reader,
MetricWriter writer)
Create a new exporter for metrics to a writer based on an empty prefix for the
metric names.
|
PrefixMetricGroupExporter(PrefixMetricReader reader,
MetricWriter writer,
String prefix)
Create a new exporter for metrics to a writer based on a prefix for the metric
names.
|
Modifier and Type | Method and 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.
|
void |
setGroups(Set<String> groups) |
protected void |
write(String group,
Collection<Metric<?>> values)
Write the values associated with a group.
|
export, setEarliestTimestamp, setIgnoreTimestamps
public PrefixMetricGroupExporter(PrefixMetricReader reader, MetricWriter writer)
reader
- a reader as the source of metricswriter
- the writer to send the metrics topublic PrefixMetricGroupExporter(PrefixMetricReader reader, MetricWriter writer, String prefix)
reader
- a reader as the source of metricswriter
- the writer to send the metrics toprefix
- the prefix for metrics to exportprotected Iterable<String> groups()
AbstractMetricExporter
groups
in class AbstractMetricExporter
protected Iterable<Metric<?>> next(String group)
AbstractMetricExporter
next
in class AbstractMetricExporter
group
- the group name to writeprotected void write(String group, Collection<Metric<?>> values)
AbstractMetricExporter
write
in class AbstractMetricExporter
group
- the group to writevalues
- the values to writeCopyright © 2014. All rights reserved.