@InterfaceAudience.Private @Metrics(context="metricssystem") public class MetricsSystemImpl extends MetricsSystem implements MetricsSource
MetricsSystem.AbstractCallback, MetricsSystem.Callback| Constructor and Description |
|---|
MetricsSystemImpl()
Construct the system but not initializing (read config etc.) it.
|
MetricsSystemImpl(String prefix)
Construct the metrics system
|
| Modifier and Type | Method and Description |
|---|---|
String |
currentConfig() |
void |
getMetrics(MetricsCollector builder,
boolean all)
Get metrics from the source
|
MetricsSource |
getSource(String name) |
MetricsSystem |
init(String prefix)
Initialized the metrics system with a prefix.
|
void |
publishMetricsNow()
Requests an immediate publish of all metrics from sources to sinks.
|
void |
register(MetricsSystem.Callback callback)
Register a callback interface for JMX events
|
<T> T |
register(String name,
String desc,
T source)
Register a metrics source
|
<T extends MetricsSink> |
register(String name,
String description,
T sink)
Register a metrics sink
|
boolean |
shutdown()
Shutdown the metrics system completely (usually during server shutdown.)
The MetricsSystemMXBean will be unregistered.
|
void |
start()
Start the metrics system
|
void |
startMetricsMBeans()
Start metrics MBeans
|
void |
stop()
Stop the metrics system
|
void |
stopMetricsMBeans()
Stop metrics MBeans.
|
registerpublic MetricsSystemImpl(String prefix)
prefix - for the systempublic MetricsSystemImpl()
public MetricsSystem init(String prefix)
init in class MetricsSystemprefix - the system will look for configs with the prefixpublic void start()
MetricsSystemMXBeanstart in interface MetricsSystemMXBeanpublic void stop()
MetricsSystemMXBeanstop in interface MetricsSystemMXBeanpublic <T> T register(String name, String desc, T source)
MetricsSystemregister in class MetricsSystemT - the actual type of the source objectname - of the source. Must be unique or null (then extracted from
the annotations of the source object.)desc - the description of the source (or null. See above.)source - object to registerpublic <T extends MetricsSink> T register(String name, String description, T sink)
MetricsSystemregister in class MetricsSystemT - the type of the sinkname - of the sink. Must be unique.description - the description of the sinksink - to registerpublic void register(MetricsSystem.Callback callback)
MetricsSystemregister in class MetricsSystemcallback - the callback object implementing the MBean interface.public void startMetricsMBeans()
MetricsSystemMXBeanstartMetricsMBeans in interface MetricsSystemMXBeanpublic void stopMetricsMBeans()
MetricsSystemMXBeanstopMetricsMBeans in interface MetricsSystemMXBeanpublic String currentConfig()
currentConfig in interface MetricsSystemMXBeanpublic void publishMetricsNow()
publishMetricsNow in class MetricsSystempublic void getMetrics(MetricsCollector builder, boolean all)
MetricsSourcegetMetrics in interface MetricsSourcebuilder - to contain the resulting metrics snapshotall - if true, return all metrics even if unchanged.public boolean shutdown()
MetricsSystemshutdown in class MetricsSystempublic MetricsSource getSource(String name)
getSource in class MetricsSystemname - of the metrics sourceCopyright © 2013 Apache Software Foundation. All rights reserved.