类 JmxMetricWriter
- java.lang.Object
- org.springframework.boot.actuate.metrics.jmx.JmxMetricWriter
- 所有已实现的接口:
CounterWriter
,GaugeWriter
,MetricWriter
@ManagedResource(description="MetricWriter for pushing metrics to JMX MBeans.") public class JmxMetricWriter extends Object implements MetricWriter
AMetricWriter
for MBeans. Each metric is registered as an individual MBean, so (for instance) it can be graphed and monitored. The object names are provided by anObjectNamingStrategy
, where the default is aDefaultMetricNamingStrategy
which providestype
,name
andvalue
keys by splitting up the metric name on periods.- 从以下版本开始:
- 1.3.0
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
JmxMetricWriter.MetricValue
A single metric value.
构造器概要
构造器 构造器 说明 JmxMetricWriter(org.springframework.jmx.export.MBeanExporter exporter)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
increment(String name, long value)
void
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).void
reset(String name)
Reset the value of a metric, usually to zero value.void
set(String name, double value)
void
set(Metric<?> value)
Set the value of a metric.void
setDomain(String domain)
void
setNamingStrategy(org.springframework.jmx.export.naming.ObjectNamingStrategy namingStrategy)
构造器详细资料
JmxMetricWriter
public JmxMetricWriter(org.springframework.jmx.export.MBeanExporter exporter)
方法详细资料
setNamingStrategy
public void setNamingStrategy(org.springframework.jmx.export.naming.ObjectNamingStrategy namingStrategy)
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
reset
@ManagedOperation public void reset(String name)
从接口复制的说明: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
- 参数:
name
- the name to reset