public enum MetricDefinition extends Enum<MetricDefinition>
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
.
Modifier and Type | Class and Description |
---|---|
static class |
MetricDefinition.BulkheadResult |
static class |
MetricDefinition.CircuitBreakerResult |
static class |
MetricDefinition.CircuitBreakerState |
static class |
MetricDefinition.InvocationFallback |
static class |
MetricDefinition.InvocationResult |
static class |
MetricDefinition.RetryResult |
static class |
MetricDefinition.RetryRetried |
static interface |
MetricDefinition.TagValue |
static class |
MetricDefinition.TimeoutTimedOut |
Modifier and Type | Method and Description |
---|---|
Class<? extends org.eclipse.microprofile.metrics.Metric> |
getMetricClass()
The subclass of
Metric used by this metric |
String |
getName()
The metric name
|
Class<? extends MetricDefinition.TagValue>[] |
getTagClasses()
The tags which are applied to this metric
|
String |
getUnit()
The metric unit
|
static MetricDefinition |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MetricDefinition[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MetricDefinition INVOCATIONS
public static final MetricDefinition RETRY_CALLS
public static final MetricDefinition RETRY_RETRIES
public static final MetricDefinition TIMEOUT_CALLS
public static final MetricDefinition TIMEOUT_EXECUTION_DURATION
public static final MetricDefinition CIRCUITBREAKER_CALLS
public static final MetricDefinition CIRCUITBREAKER_STATE
public static final MetricDefinition CIRCUITBREAKER_OPENED
public static final MetricDefinition BULKHEAD_CALLS
public static final MetricDefinition BULKHEAD_EXECUTIONS_RUNNING
public static final MetricDefinition BULKHEAD_EXECUTIONS_WAITING
public static final MetricDefinition BULKHEAD_RUNNING_DURATION
public static final MetricDefinition BULKHEAD_WAITING_DURATION
public static MetricDefinition[] values()
for (MetricDefinition c : MetricDefinition.values()) System.out.println(c);
public static MetricDefinition valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
public String getUnit()
public Class<? extends org.eclipse.microprofile.metrics.Metric> getMetricClass()
Metric
used by this metricpublic Class<? extends MetricDefinition.TagValue>[] getTagClasses()
The classes returned from this method will be enums which implement MetricDefinition.TagValue
Copyright © 2016 – 2022 Eclipse Foundation. All rights reserved.
Use is subject to license terms.