Class MetricsUtil
java.lang.Object
com.mapr.org.apache.hadoop.metrics.MetricsUtil
Utility class to simplify creation and reporting of hadoop metrics.
For examples of usage, see NameNodeMetrics.
- See Also:
-
org.apache.hadoop.metrics.MetricsRecordorg.apache.hadoop.metrics.MetricsContextorg.apache.hadoop.metrics.ContextFactory
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricsRecordcreateRecord(MetricsContext context, String recordName) Utility method to create and return new metrics record instance within the given context.static MetricsContextgetContext(String contextName) static MetricsContextgetContext(String refName, String contextName) Utility method to return the named context.
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Method Details
-
getContext
-
getContext
Utility method to return the named context. If the desired context cannot be created for any reason, the exception is logged, and a null context is returned. -
createRecord
Utility method to create and return new metrics record instance within the given context. This record is tagged with the host name.- Parameters:
context- the contextrecordName- name of the record- Returns:
- newly created metrics record
-