java.lang.Object
java.lang.Enum<MetricDefinition>
org.eclipse.microprofile.fault.tolerance.tck.metrics.util.MetricDefinition
All Implemented Interfaces:
Serializable, Comparable<MetricDefinition>

public enum MetricDefinition extends Enum<MetricDefinition>
Enum containing a definition for each metric defined in the spec.

All tests should not use this enum directly, but should use MetricGetter to access metric values. However, if we add new metrics to the spec, their definitions should be added here. Having a defined list of all metrics allows us to easily iterate through them for stuff like MetricGetter.baselineMetrics().

Each metric definition has a name, a type and a set of tags.

Each fault tolerance metric is assumed to have a method tag, so the set of tags does not include a method tag.

Each tag in the set is represented by an enum which implements MetricDefinition.TagValue. Each enum has one entry for each valid value for that tag.

For example, the metric ft.bulkhead.calls.total has one tag, bulkheadResult which can have the value accepted or rejected. The value for this is BULKHEAD_CALLS and calling BULKHEAD_CALLS.getArgumentClasses() returns MetricDefinition.BulkheadResult, which is an enum with two entries, MetricDefinition.BulkheadResult.ACCEPTED and MetricDefinition.BulkheadResult.REJECTED.

  • Enum Constant Details

    • INVOCATIONS

      public static final MetricDefinition INVOCATIONS
    • RETRY_CALLS

      public static final MetricDefinition RETRY_CALLS
    • RETRY_RETRIES

      public static final MetricDefinition RETRY_RETRIES
    • TIMEOUT_CALLS

      public static final MetricDefinition TIMEOUT_CALLS
    • TIMEOUT_EXECUTION_DURATION

      public static final MetricDefinition TIMEOUT_EXECUTION_DURATION
    • CIRCUITBREAKER_CALLS

      public static final MetricDefinition CIRCUITBREAKER_CALLS
    • CIRCUITBREAKER_STATE

      public static final MetricDefinition CIRCUITBREAKER_STATE
    • CIRCUITBREAKER_OPENED

      public static final MetricDefinition CIRCUITBREAKER_OPENED
    • BULKHEAD_CALLS

      public static final MetricDefinition BULKHEAD_CALLS
    • BULKHEAD_EXECUTIONS_RUNNING

      public static final MetricDefinition BULKHEAD_EXECUTIONS_RUNNING
    • BULKHEAD_EXECUTIONS_WAITING

      public static final MetricDefinition BULKHEAD_EXECUTIONS_WAITING
    • BULKHEAD_RUNNING_DURATION

      public static final MetricDefinition BULKHEAD_RUNNING_DURATION
    • BULKHEAD_WAITING_DURATION

      public static final MetricDefinition BULKHEAD_WAITING_DURATION
  • Method Details

    • values

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

      public static MetricDefinition 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
    • getName

      public String getName()
      The metric name
      Returns:
      the name
    • getUnit

      public String getUnit()
      The metric unit
      Returns:
      the unit
    • getMetricClass

      public Class<? extends org.eclipse.microprofile.metrics.Metric> getMetricClass()
      The subclass of Metric used by this metric
      Returns:
      the metric class
    • getTagClasses

      public Class<? extends MetricDefinition.TagValue>[] getTagClasses()
      The tags which are applied to this metric

      The classes returned from this method will be enums which implement MetricDefinition.TagValue

      Returns:
      the tags which are applied to this metric