类 MetricCopyExporter
- java.lang.Object
- org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
- org.springframework.boot.actuate.metrics.export.MetricCopyExporter
- 所有已实现的接口:
Closeable
,Flushable
,AutoCloseable
,Exporter
public class MetricCopyExporter extends AbstractMetricExporter
Exporter
that "exports" by copying metric data from a sourceMetricReader
to a destinationMetricWriter
. Actually the output writer can be aGaugeWriter
, in which case all metrics are simply output as their current value. If the output writer is also aCounterWriter
then metrics whose names begin with "counter." are special: instead of writing them out as simple gauges the writer will increment the counter value. This involves the exporter storing the previous value of the counter so the delta can be computed. For best results with the counters, do not use the exporter concurrently in multiple threads (normally it will only be used periodically and sequentially, even if it is in a background thread, and this is fine).- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 MetricCopyExporter(MetricReader reader, GaugeWriter writer)
Create a newMetricCopyExporter
instance.MetricCopyExporter(MetricReader reader, GaugeWriter writer, String prefix)
Create a newMetricCopyExporter
instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
flush()
protected Iterable<Metric<?>>
next(String group)
Get the next group of metrics to write.void
setExcludes(String... excludes)
Set the exclude patterns used to filter metrics.void
setIncludes(String... includes)
Set the include patterns used to filter metrics.protected void
write(String group, Collection<Metric<?>> values)
Write the values associated with a group.从类继承的方法 org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
close, export, groups, setEarliestTimestamp, setIgnoreTimestamps, setSendLatest
构造器详细资料
MetricCopyExporter
public MetricCopyExporter(MetricReader reader, GaugeWriter writer)
Create a newMetricCopyExporter
instance.- 参数:
reader
- the metric readerwriter
- the metric writer
MetricCopyExporter
public MetricCopyExporter(MetricReader reader, GaugeWriter writer, String prefix)
Create a newMetricCopyExporter
instance.- 参数:
reader
- the metric readerwriter
- the metric writerprefix
- the name prefix
方法详细资料
setIncludes
public void setIncludes(String... includes)
Set the include patterns used to filter metrics.- 参数:
includes
- the include patterns
setExcludes
public void setExcludes(String... excludes)
Set the exclude patterns used to filter metrics.- 参数:
excludes
- the exclude patterns
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
flush
public void flush()
- 指定者:
flush
在接口中Flushable
- 覆盖:
flush
在类中AbstractMetricExporter