org.apache.hadoop.metrics2
Interface MetricsSystem

All Superinterfaces:
MetricsSystemMXBean
All Known Implementing Classes:
DefaultMetricsSystem, MetricsSystemImpl

public interface MetricsSystem
extends MetricsSystemMXBean

The metrics system interface


Nested Class Summary
static class MetricsSystem.AbstractCallback
          Convenient abstract class for implementing callback interface
static interface MetricsSystem.Callback
          The metrics system callback interface
 
Method Summary
 void register(MetricsSystem.Callback callback)
          Register a callback interface for JMX events
<T extends MetricsSink>
T
register(String name, String desc, T sink)
          Register a metrics sink
<T extends MetricsSource>
T
register(String name, String desc, T source)
          Register a metrics source
 void shutdown()
          Shutdown the metrics system completely (usually during server shutdown.) The MetricsSystemMXBean will be unregistered.
 
Methods inherited from interface org.apache.hadoop.metrics2.MetricsSystemMXBean
currentConfig, refreshMBeans, start, stop
 

Method Detail

register

<T extends MetricsSource> T register(String name,
                                     String desc,
                                     T source)
Register a metrics source

Type Parameters:
T - the type of the source
Parameters:
source - to register
name - of the source. Must be unique.
desc - the description of the source.
Returns:
the source
Throws:
MetricsException

register

<T extends MetricsSink> T register(String name,
                                   String desc,
                                   T sink)
Register a metrics sink

Type Parameters:
T - the type of the sink
Parameters:
sink - to register
name - of the sink. Must be unique.
desc - the description of the sink
Returns:
the sink
Throws:
MetricsException

register

void register(MetricsSystem.Callback callback)
Register a callback interface for JMX events

Parameters:
callback - the callback object implementing the MBean interface.

shutdown

void shutdown()
Shutdown the metrics system completely (usually during server shutdown.) The MetricsSystemMXBean will be unregistered.



Copyright © 2009 The Apache Software Foundation