@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class MetricsSystem extends Object implements MetricsSystemMXBean
MetricsSource
generate and update metrics information.MetricsSink
consume the metrics informationMetricsSource
and MetricsSink
register with the metrics
system. Implementations of MetricsSystem
polls the
MetricsSource
s periodically and pass the MetricsRecord
s to
MetricsSink
.Constructor and Description |
---|
MetricsSystem() |
Modifier and Type | Method and Description |
---|---|
abstract void |
publishMetricsNow()
Requests an immediate publish of all metrics from sources to sinks.
|
abstract void |
register(org.apache.hadoop.metrics2.MetricsSystem.Callback callback)
Register a callback interface for JMX events
|
abstract <T> T |
register(String name,
String desc,
T source)
Register a metrics source
|
abstract <T extends MetricsSink> |
register(String name,
String desc,
T sink)
Register a metrics sink
|
<T> T |
register(T source)
Register a metrics source (deriving name and description from the object)
|
abstract boolean |
shutdown()
Shutdown the metrics system completely (usually during server shutdown.)
The MetricsSystemMXBean will be unregistered.
|
abstract void |
unregisterSource(String name)
Unregister a metrics source
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
currentConfig, start, startMetricsMBeans, stop, stopMetricsMBeans
public MetricsSystem()
public abstract <T> T register(String name, String desc, T source)
T
- the actual type of the source objectsource
- object to registername
- 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.)MetricsException
public abstract void unregisterSource(String name)
name
- of the source. This is the name you use to call register()public <T> T register(T source)
T
- the actual type of the source objectsource
- object to registerMetricsException
public abstract <T extends MetricsSink> T register(String name, String desc, T sink)
T
- the type of the sinksink
- to registername
- of the sink. Must be unique.desc
- the description of the sinkMetricsException
public abstract void register(org.apache.hadoop.metrics2.MetricsSystem.Callback callback)
callback
- the callback object implementing the MBean interface.public abstract void publishMetricsNow()
public abstract boolean shutdown()
Copyright © 2015 Apache Software Foundation. All rights reserved.