类 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object obj)
String
getName()
Returns the name of the metric.Date
getTimestamp()
T
getValue()
Returns the value of the metric.int
hashCode()
Metric<Long>
increment(int amount)
Create a newMetric
with an incremented value.<S extends Number>
Metric<S>set(S value)
Create a newMetric
with a different value.String
toString()
方法详细资料
getTimestamp
public Date getTimestamp()
increment
public Metric<Long> increment(int amount)
Create a newMetric
with an incremented value.- 参数:
amount
- the amount that the new metric will differ from this one- 返回:
- a new
Metric
instance
set
public <S extends Number> Metric<S> set(S value)
Create a newMetric
with a different value.- 类型参数:
S
- the metric value type- 参数:
value
- the value of the new metric- 返回:
- a new
Metric
instance