org.apache.hadoop.metrics2.annotation
Annotation Type Metric


@InterfaceAudience.Public
@InterfaceStability.Evolving
@Documented
@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface Metric

Annotation interface for a single metric


Optional Element Summary
 String about
           
 boolean always
           
 String sampleName
           
 org.apache.hadoop.metrics2.annotation.Metric.Type type
           
 String[] value
          Shorthand for optional name and description
 String valueName
           
 

value

public abstract String[] value
Shorthand for optional name and description

Returns:
{description} or {name, description}
Default:
{}

about

public abstract String about
Returns:
optional description of the metric
Default:
""

sampleName

public abstract String sampleName
Returns:
optional sample name for MutableStat/Rate/Rates
Default:
"Ops"

valueName

public abstract String valueName
Returns:
optional value name for MutableStat/Rate/Rates
Default:
"Time"

always

public abstract boolean always
Returns:
true to create a metric snapshot even if unchanged.
Default:
false

type

public abstract org.apache.hadoop.metrics2.annotation.Metric.Type type
Returns:
optional type (counter|gauge) of the metric
Default:
org.apache.hadoop.metrics2.annotation.Metric.Type.DEFAULT


Copyright © 2014 Apache Software Foundation. All Rights Reserved.