Metric (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2.annotation, annotation type: Metric

Package org.apache.hadoop.metrics2.annotation

# Annotation Interface Metric

@Public @Evolving @Documented @Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface Metric
Annotation interface for a single metric used to annotate a field or a method in the class.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `Metric.Type`

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `String`
  `about`
  `boolean`
  `always`
  `int`
  `interval`
  `String`
  `sampleName`
  `Metric.Type`
  `type`
  `String[]`
  `value`
  Shorthand for optional name and description
  `String`
  `valueName`

- ## Element Details

  - ### value

    String[] value
    Shorthand for optional name and description
    Returns:
      {description} or {name, description}
    Default:
      {}

  - ### about

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

  - ### sampleName

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

  - ### valueName

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

  - ### always

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

  - ### type

    Metric.Type type
    Returns:
      optional type (counter|gauge) of the metric
    Default:
      DEFAULT

  - ### interval

    int interval
    Returns:
      optional roll over interval in secs for MutableQuantiles
    Default:
      10