Class MetricsRegistry
- java.lang.Object
-
- com.mapr.org.apache.hadoop.metrics.util.MetricsRegistry
-
@LimitedPrivate({"HDFS","MapReduce"}) public class MetricsRegistry extends java.lang.ObjectThis is the registry for metrics. Related set of metrics should be declared in a holding class and registered in a registry for those metrics which is also stored in the the holding class.
-
-
Constructor Summary
Constructors Constructor Description MetricsRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String metricsName, MetricsBase theMetricsObj)Add a new metrics to the registryMetricsBaseget(java.lang.String metricsName)java.util.Collection<java.lang.String>getKeyList()java.util.Collection<MetricsBase>getMetricsList()intsize()
-
-
-
Method Detail
-
size
public int size()
- Returns:
- number of metrics in the registry
-
add
public void add(java.lang.String metricsName, MetricsBase theMetricsObj)Add a new metrics to the registry- Parameters:
metricsName- - the nametheMetricsObj- - the metrics- Throws:
java.lang.IllegalArgumentException- if a name is already registered
-
get
public MetricsBase get(java.lang.String metricsName)
- Parameters:
metricsName-- Returns:
- the metrics if there is one registered by the supplied name. Returns null if none is registered
-
getKeyList
public java.util.Collection<java.lang.String> getKeyList()
- Returns:
- the list of metrics names
-
getMetricsList
public java.util.Collection<MetricsBase> getMetricsList()
- Returns:
- the list of metrics
-
-