类 AbstractMetricExporter
- java.lang.Object
- org.springframework.boot.actuate.metrics.export.AbstractMetricExporter
- 所有已实现的接口:
Closeable
,Flushable
,AutoCloseable
,Exporter
public abstract class AbstractMetricExporter extends Object implements Exporter, Closeable, Flushable
Base class for metric exporters that have common features, principally a prefix for exported metrics and filtering by timestamp (so only new values are included in the export).- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 AbstractMetricExporter(String prefix)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 void
close()
void
export()
Export metric data.void
flush()
protected Iterable<String>
groups()
Generate a group of metrics to iterate over in the form of a set of Strings (e.g.protected abstract Iterable<Metric<?>>
next(String group)
Get the next group of metrics to write.void
setEarliestTimestamp(Date earliestTimestamp)
The earliest time for which data will be exported.void
setIgnoreTimestamps(boolean ignoreTimestamps)
Ignore timestamps (export all metrics).void
setSendLatest(boolean sendLatest)
Send only the data that changed since the last export.protected abstract void
write(String group, Collection<Metric<?>> values)
Write the values associated with a group.
构造器详细资料
AbstractMetricExporter
public AbstractMetricExporter(String prefix)
方法详细资料
setEarliestTimestamp
public void setEarliestTimestamp(Date earliestTimestamp)
The earliest time for which data will be exported.- 参数:
earliestTimestamp
- the timestamp to set
setIgnoreTimestamps
public void setIgnoreTimestamps(boolean ignoreTimestamps)
Ignore timestamps (export all metrics).- 参数:
ignoreTimestamps
- the flag to set
setSendLatest
public void setSendLatest(boolean sendLatest)
Send only the data that changed since the last export.- 参数:
sendLatest
- the flag to set
close
public void close() throws IOException
- 指定者:
close
在接口中AutoCloseable
- 指定者:
close
在接口中Closeable
- 抛出:
IOException
groups
protected Iterable<String> groups()
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 of metrics to iterate over (default singleton empty string)
write
protected abstract void write(String group, Collection<Metric<?>> values)
Write the values associated with a group.- 参数:
group
- the group to writevalues
- the values to write