org.apache.hadoop.metrics2.lib
Class AbstractMetricsSource
java.lang.Object
org.apache.hadoop.metrics2.lib.AbstractMetricsSource
- All Implemented Interfaces:
- MetricsSource
- Direct Known Subclasses:
- RpcInstrumentation.Detailed
public abstract class AbstractMetricsSource
- extends Object
- implements MetricsSource
A convenient base class for writing metrics sources
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
registry
protected final MetricsRegistry registry
AbstractMetricsSource
public AbstractMetricsSource(String name,
MetricMutableFactory mf)
- Construct the source with name and a mutable metrics factory
- Parameters:
name
- of the default recordmf
- the factory to create mutable metrics
AbstractMetricsSource
public AbstractMetricsSource(String name)
- Construct the source with a name with a default factory
- Parameters:
name
- of the default record
registry
public MetricsRegistry registry()
- Returns:
- the registry for mutable metrics
getMetrics
public void getMetrics(MetricsBuilder builder,
boolean all)
- Description copied from interface:
MetricsSource
- Get metrics from the source
- Specified by:
getMetrics
in interface MetricsSource
- Parameters:
builder
- to contain the resulting metrics snapshotall
- if true, return all metrics even if unchanged.
Copyright © 2009 The Apache Software Foundation