org.eclipse.microprofile.metrics

## Enum MetricType

- java.lang.Object
- - java.lang.Enum<MetricType>
  - - org.eclipse.microprofile.metrics.MetricType

All Implemented Interfaces:
  Serializable, Comparable<MetricType>

    public enum MetricType
    extends Enum<MetricType>

An enumeration representing the different types of metrics.

Author:
  hrupp, Raymond Lam, Ouyang Zhou

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`CONCURRENT_GAUGE` A concurrent gauge counts the number of parallel invocations of a target (method).
`COUNTER` A Counter monotonically increases its values.
`GAUGE` A Gauge has values that 'arbitrarily' goes up/down at each sampling.
`HISTOGRAM` A Histogram calculates the distribution of a value.
`INVALID` Invalid - Placeholder
`METERED` A Meter measures the rate at which a set of events occur.
`SIMPLE_TIMER` A simple timer aggregates timing durations
`TIMER` A timer aggregates timing durations and provides duration statistics, plus throughput statistics

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static MetricType` `from(Class<?> in)` Convert the metric Java class into a MetricType
`static MetricType` `from(String in)` Convert the string representation into an enum
`static MetricType` `fromClassName(String className)` Convert the metric Java class name into a MetricType
`String` `toString()`
`static MetricType` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static MetricType[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### CONCURRENT_GAUGE

    public static final MetricType CONCURRENT_GAUGE

A concurrent gauge counts the number of parallel invocations of a target (method). Upon entering the target the value is increased. It is decreased again upon exiting the target.

#### COUNTER

    public static final MetricType COUNTER

A Counter monotonically increases its values. An example could be the number of Transactions committed.

#### GAUGE

    public static final MetricType GAUGE

A Gauge has values that 'arbitrarily' goes up/down at each sampling. An example could be CPU load

#### METERED

    public static final MetricType METERED

A Meter measures the rate at which a set of events occur. An example could be amount of Transactions per Hour.

#### HISTOGRAM

    public static final MetricType HISTOGRAM

A Histogram calculates the distribution of a value.

#### TIMER

    public static final MetricType TIMER

A timer aggregates timing durations and provides duration statistics, plus throughput statistics

#### SIMPLE_TIMER

    public static final MetricType SIMPLE_TIMER

A simple timer aggregates timing durations

#### INVALID

    public static final MetricType INVALID

Invalid - Placeholder

### Method Detail

#### values

    public static MetricType[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (MetricType c : MetricType.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static MetricType valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### toString

    public String toString()

Overrides:
  `toString` in class `Enum<MetricType>`

#### from

    public static MetricType from(String in)

Convert the string representation into an enum

Parameters:
  `in` - the String representation (NOT the class name but rather a string like "counter", "gauge",...)
Returns:
  the matching Enum
Throws:
  `IllegalArgumentException` - if in is not a valid enum value

#### from

    public static MetricType from(Class<?> in)

Convert the metric Java class into a MetricType

Parameters:
  `in` - The metric class
Returns:
  the matching MetricType value
Throws:
  `IllegalArgumentException` - if in is not a valid metric class

#### fromClassName

    public static MetricType fromClassName(String className)

Convert the metric Java class name into a MetricType

Parameters:
  `className` - The name of a metric class
Returns:
  the matching MetricType value
Throws:
  `IllegalArgumentException` - if className is not a valid metric class