MetricsUtil (Hadoop 0.20.2+737 API)
Date: 2010-10-11

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.metrics
Class MetricsUtil

    java.lang.Object
      org.apache.hadoop.metrics.MetricsUtil

    public class MetricsUtil

extends Object

Utility class to simplify creation and reporting of hadoop metrics. For examples of usage, see NameNodeMetrics.

See Also:
  `MetricsRecord`, `MetricsContext`, `ContextFactory`

Field Summary
`static org.apache.commons.logging.Log` | `LOG`

Method Summary
`static MetricsRecord` | `createRecord(MetricsContext context, String recordName)` Utility method to create and return new metrics record instance within the given context.
`static MetricsContext` | `getContext(String contextName)`
`static MetricsContext` | `getContext(String refName, String contextName)` Utility method to return the named context.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### LOG

    public static final org.apache.commons.logging.Log LOG

Method Detail

### getContext

    public static MetricsContext getContext(String contextName)

### getContext

    public static MetricsContext getContext(String refName,
                                            String contextName)

  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

    public static MetricsRecord createRecord(MetricsContext context,
                                             String recordName)

  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 context
    `recordName` - name of the record
  Returns:
    newly created metrics record

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation