类 Metric<T extends Number>
- java.lang.Object
- org.springframework.boot.actuate.metrics.Metric<T>
- 类型参数:
T- the value type
- 直接已知子类:
Delta
public class Metric<T extends Number> extends Object
Immutable class that can be used to hold any arbitrary system measurement value (a named numeric value with a timestamp). For example a metric might record the number of active connections to a server, or the temperature of a meeting room.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(Object obj)StringgetName()Returns the name of the metric.DategetTimestamp()TgetValue()Returns the value of the metric.inthashCode()Metric<Long>increment(int amount)Create a newMetricwith an incremented value.<S extends Number>
Metric<S>set(S value)Create a newMetricwith a different value.StringtoString()
方法详细资料
getTimestamp
public Date getTimestamp()
increment
public Metric<Long> increment(int amount)
Create a newMetricwith an incremented value.- 参数:
amount- the amount that the new metric will differ from this one- 返回:
- a new
Metricinstance
set
public <S extends Number> Metric<S> set(S value)
Create a newMetricwith a different value.- 类型参数:
S- the metric value type- 参数:
value- the value of the new metric- 返回:
- a new
Metricinstance