|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.metrics.Metrics
public class Metrics
Utility class to simplify creation and reporting of hadoop metrics.
For examples of usage, see DataNode
.
MetricsRecord
,
MetricsContext
,
ContextFactory
Method Summary | |
---|---|
static MetricsRecord |
createRecord(String contextName,
String recordName)
Utility method to create and return new metrics record instance within the given contextName . |
static MetricsRecord |
createRecord(String contextName,
String recordName,
String tagName,
String tagValue)
Utility method to create and return a new tagged metrics record instance within the given contextName . |
static void |
report(MetricsRecord record,
String metricName,
long metricValue)
Sets the named metric to the specified value in the given metrics record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MetricsRecord createRecord(String contextName, String recordName, String tagName, String tagValue)
contextName
.
If exception is thrown while creating the record for any reason, it is
logged, and a null record is returned.
contextName
- name of the contextrecordName
- the name of the recordtagName
- name of the tag field of metrics recordtagValue
- value of the tag field
public static MetricsRecord createRecord(String contextName, String recordName)
contextName
. This record is tagged with hostname.
If exception is thrown while creating the record due to any reason, it is
logged, and a null record is returned.
contextName
- name of the contextrecordName
- name of the record
public static void report(MetricsRecord record, String metricName, long metricValue)
record
- record for which the metric is updatedmetricName
- name of the metricmetricValue
- new value of the metric
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |