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

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