类 InMemoryMetricRepository
- java.lang.Object
- org.springframework.boot.actuate.metrics.repository.InMemoryMetricRepository
- 所有已实现的接口:
MetricReader
,MetricRepository
,CounterWriter
,GaugeWriter
,MetricWriter
public class InMemoryMetricRepository extends Object implements MetricRepository
MetricRepository
implementation that stores metrics in memory.
构造器概要
构造器 构造器 说明 InMemoryMetricRepository()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 long
count()
The number of metrics known to this reader.Iterable<Metric<?>>
findAll()
Find all the metrics known to this reader.Iterable<Metric<?>>
findAllWithPrefix(String prefix)
Metric<?>
findOne(String metricName)
Find an instance of the metric with the given name (usually the latest recorded value).void
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).void
reset(String metricName)
Reset the value of a metric, usually to zero value.void
set(Metric<?> value)
Set the value of a metric.void
setValues(ConcurrentNavigableMap<String,Metric<?>> values)
构造器详细资料
InMemoryMetricRepository
public InMemoryMetricRepository()
方法详细资料
setValues
public void setValues(ConcurrentNavigableMap<String,Metric<?>> values)
increment
public void increment(Delta<?> delta)
从接口复制的说明:CounterWriter
Increment the value of a metric (or decrement if the delta is negative). The name of the delta is the name of the metric to increment.- 指定者:
increment
在接口中CounterWriter
- 参数:
delta
- the amount to increment by
set
public void set(Metric<?> value)
从接口复制的说明:GaugeWriter
Set the value of a metric.- 指定者:
set
在接口中GaugeWriter
- 参数:
value
- the value
count
public long count()
从接口复制的说明:MetricReader
The number of metrics known to this reader.- 指定者:
count
在接口中MetricReader
- 返回:
- the number of metrics
reset
public void reset(String metricName)
从接口复制的说明:CounterWriter
Reset the value of a metric, usually to zero value. Implementations can discard the old values if desired, but may choose not to. This operation is optional (some implementations may not be able to fulfill the contract, in which case they should simply do nothing).- 指定者:
reset
在接口中CounterWriter
- 参数:
metricName
- the name to reset
findOne
public Metric<?> findOne(String metricName)
从接口复制的说明:MetricReader
Find an instance of the metric with the given name (usually the latest recorded value).- 指定者:
findOne
在接口中MetricReader
- 参数:
metricName
- the name of the metric to find- 返回:
- a metric value or null if there are none with that name
findAll
public Iterable<Metric<?>> findAll()
从接口复制的说明:MetricReader
Find all the metrics known to this reader.- 指定者:
findAll
在接口中MetricReader
- 返回:
- all instances of metrics known to this reader
findAllWithPrefix
public Iterable<Metric<?>> findAllWithPrefix(String prefix)