Package org.eclipse.microprofile.metrics
Enum MetricType
- java.lang.Object
-
- java.lang.Enum<MetricType>
-
- org.eclipse.microprofile.metrics.MetricType
-
public enum MetricType extends java.lang.Enum<MetricType>
An enumeration representing the different types of metrics.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description COUNTER
A Counter monotonically in-/decreases 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 - PlaceholderMETERED
A Meter measures the rate at which a set of events occur.TIMER
A timer aggregates timing durations and provides duration statistics, plus throughput statistics
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetricType
from(java.lang.Class<?> in)
Convert the metric class type into an enumstatic MetricType
from(java.lang.String in)
Convert the string representation into an enumjava.lang.String
toString()
static MetricType
valueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
COUNTER
public static final MetricType COUNTER
A Counter monotonically in-/decreases 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
-
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(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<MetricType>
-
from
public static MetricType from(java.lang.String in)
Convert the string representation into an enum- Parameters:
in
- the String representation- Returns:
- the matching Enum
- Throws:
java.lang.IllegalArgumentException
- if in is not a valid enum value
-
from
public static MetricType from(java.lang.Class<?> in)
Convert the metric class type into an enum- Parameters:
in
- The metric class type- Returns:
- the matching Enum
- Throws:
java.lang.IllegalArgumentException
- if in is not a valid enum value
-
-