类 PrefixMetricGroupExporter
- java.lang.Object
- org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
- org.springframework.boot.actuate.metrics.export.PrefixMetricGroupExporter
- 所有已实现的接口:
Closeable
,Flushable
,AutoCloseable
,Exporter
public class PrefixMetricGroupExporter extends AbstractMetricExporter
A convenient exporter for a group of metrics from aPrefixMetricReader
. Exports all metrics whose name starts with a prefix (or all metrics if the prefix is empty).- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 PrefixMetricGroupExporter(PrefixMetricReader reader, PrefixMetricWriter writer)
Create a new exporter for metrics to a writer based on an empty prefix for the metric names.PrefixMetricGroupExporter(PrefixMetricReader reader, PrefixMetricWriter writer, String prefix)
Create a new exporter for metrics to a writer based on a prefix for the metric names.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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)
The groups to export.protected void
write(String group, Collection<Metric<?>> values)
Write the values associated with a group.从类继承的方法 org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
close, export, flush, setEarliestTimestamp, setIgnoreTimestamps, setSendLatest
构造器详细资料
PrefixMetricGroupExporter
public PrefixMetricGroupExporter(PrefixMetricReader reader, PrefixMetricWriter writer)
Create a new exporter for metrics to a writer based on an empty prefix for the metric names.- 参数:
reader
- a reader as the source of metricswriter
- the writer to send the metrics to
PrefixMetricGroupExporter
public PrefixMetricGroupExporter(PrefixMetricReader reader, PrefixMetricWriter writer, String prefix)
Create a new exporter for metrics to a writer based on a prefix for the metric names.- 参数:
reader
- a reader as the source of metricswriter
- the writer to send the metrics toprefix
- the prefix for metrics to export
方法详细资料
setGroups
public void setGroups(Set<String> groups)
The groups to export.- 参数:
groups
- the groups to set
groups
protected Iterable<String> groups()
从类复制的说明: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).- 覆盖:
groups
在类中AbstractMetricExporter
- 返回:
- groups of metrics to iterate over (default singleton empty string)
next
protected Iterable<Metric<?>> next(String group)
从类复制的说明:AbstractMetricExporter
Get the next group of metrics to write.- 指定者:
next
在类中AbstractMetricExporter
- 参数:
group
- the group name to write- 返回:
- some metrics to write
write
protected void write(String group, Collection<Metric<?>> values)
从类复制的说明:AbstractMetricExporter
Write the values associated with a group.- 指定者:
write
在类中AbstractMetricExporter
- 参数:
group
- the group to writevalues
- the values to write