Enum Class MetricType

java.lang.Object
java.lang.Enum<MetricType>
org.eclipse.microprofile.metrics.MetricType
All Implemented Interfaces:
Serializable, Comparable<MetricType>, Constable

public enum MetricType extends Enum<MetricType>
An enumeration representing the different types of metrics.
  • Enum Constant Details

    • 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 Details

    • values

      public static MetricType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MetricType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class 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
      Returns:
      the matching Enum
      Throws:
      IllegalArgumentException - if in is not a valid enum value
    • from

      public static MetricType from(Class<?> in)
      Convert the metric class type into an enum
      Parameters:
      in - The metric class type
      Returns:
      the matching Enum
      Throws:
      IllegalArgumentException - if in is not a valid enum value