public interface FaultToleranceMetrics
MetricRegistry.
The metrics are bound to a specific invocation context which is not an argument to each of the provided methods but
passed to the implementation upon construction. For another invocation another metrics instance is bound.| Modifier and Type | Interface and Description |
|---|---|
static class |
FaultToleranceMetrics.FallbackUsage |
| Modifier and Type | Field and Description |
|---|---|
static FaultToleranceMetrics |
DISABLED
Can be used as NULL object when metrics are disabled so avoid testing for enabled but still do essentially NOOPs.
|
static org.eclipse.microprofile.metrics.Tag[] |
NO_TAGS |
| Modifier and Type | Method and Description |
|---|---|
default void |
addBulkheadExecutionDuration(long nanos)
Histogram of the time that method executions spent running
|
default void |
addBulkheadWaitingDuration(long nanos)
Histogram of the time that method executions spent waiting in the queue
Only added if the method is also annotated with
Asynchronous |
default void |
addTimeoutExecutionDuration(long nanos)
Histogram of execution times for the method
|
default void |
addToHistogram(String metric,
long nanos) |
default void |
addToHistogram(String metric,
long nanos,
org.eclipse.microprofile.metrics.Tag... tags)
Histogram:
|
default FaultToleranceMetrics |
boundTo(FaultToleranceMethodContext context,
FaultTolerancePolicy policy) |
default FaultToleranceMetrics.FallbackUsage |
getFallbackUsage() |
default void |
incrementBulkheadCallsAcceptedTotal()
The number of times the bulkhead logic was run.
|
default void |
incrementBulkheadCallsRejectedTotal()
The number of times the bulkhead logic was run.
|
default void |
incrementCircuitbreakerCallsFailedTotal()
The number of times the circuit breaker logic was run.
|
default void |
incrementCircuitbreakerCallsPreventedTotal()
The number of times the circuit breaker logic was run.
|
default void |
incrementCircuitbreakerCallsSucceededTotal()
The number of times the circuit breaker logic was run.
|
default void |
incrementCircuitbreakerOpenedTotal()
Number of times the circuit breaker has moved from closed state to open state
|
default void |
incrementCounter(String metric) |
default void |
incrementCounter(String metric,
org.eclipse.microprofile.metrics.Tag... tags)
Counters:
|
default void |
incrementFallbackCallsTotal() |
default void |
incrementInvocationsExceptionThrown()
The number of times the method was called when an exception was thrown.
|
default void |
incrementInvocationsValueReturned()
The number of times the method was called when a value was returned.
|
default void |
incrementRetryCallsExceptionNotRetryable()
The number of times the retry logic was run.
|
default void |
incrementRetryCallsMaxDurationReached()
The number of times the retry logic was run.
|
default void |
incrementRetryCallsMaxRetriesReached()
The number of times the retry logic was run.
|
default void |
incrementRetryCallsValueReturned()
The number of times the retry logic was run.
|
default void |
incrementRetryRetriesTotal()
The number of times the method was retried
|
default void |
incrementTimeoutCallsNotTimedOutTotal()
The number of times the timeout logic was run.
|
default void |
incrementTimeoutCallsTimedOutTotal()
The number of times the timeout logic was run.
|
default boolean |
isRetried() |
default void |
register(org.eclipse.microprofile.metrics.MetricType type,
String metric,
String[]... tags)
Registration:
Registers a metric for each permutation of the tags.
|
default void |
register(String metric,
String unit,
LongSupplier gauge,
String... tag)
Gauge registration:
|
static final FaultToleranceMetrics DISABLED
static final org.eclipse.microprofile.metrics.Tag[] NO_TAGS
default FaultToleranceMetrics boundTo(FaultToleranceMethodContext context, FaultTolerancePolicy policy)
FaultToleranceMetrics that is properly adopted to the provided
context and policy. This can be the same instance if no change is required or a new one if a change of
internal state is required.
As part of binding to the context and policy this method also should register all metrics that make sense
for the provided policy in case this has not been done already.default void register(org.eclipse.microprofile.metrics.MetricType type,
String metric,
String[]... tags)
type - MetricType.COUNTER (assumes no unit) or MetricType.HISTOGRAM (assumes MetricUnits.NANOSECONDS)metric - name of the metric(s)tags - tag name and possible valuesdefault void register(String metric, String unit, LongSupplier gauge, String... tag)
metric - name of the gauge metricunit - unit of the gauge metric (null is MetricUnits.NONE)gauge - a supplier function for the gaugetag - tag name and value if the gauge uses a tagdefault void incrementCounter(String metric, org.eclipse.microprofile.metrics.Tag... tags)
metric - full name of the metric with %s used as placeholder for the method nametags - all tags to add for the metric except the method tag (which is added later internally)default void incrementCounter(String metric)
default void addToHistogram(String metric, long nanos, org.eclipse.microprofile.metrics.Tag... tags)
metric - full name of the metric with %s used as placeholder for the method namenanos - amount of nanoseconds to add to the histogram (>= 0)tags - all tags to add for the metric except the method tag (which is added later internally)default void addToHistogram(String metric, long nanos)
default void incrementInvocationsValueReturned()
default void incrementInvocationsExceptionThrown()
default FaultToleranceMetrics.FallbackUsage getFallbackUsage()
default void incrementRetryCallsValueReturned()
default void incrementRetryCallsExceptionNotRetryable()
default void incrementRetryCallsMaxDurationReached()
default void incrementRetryCallsMaxRetriesReached()
default void incrementRetryRetriesTotal()
default boolean isRetried()
incrementRetryRetriesTotal() has been called at least once, otherwise falsedefault void addTimeoutExecutionDuration(long nanos)
nanos - Nanosecondsdefault void incrementTimeoutCallsTimedOutTotal()
default void incrementTimeoutCallsNotTimedOutTotal()
default void incrementCircuitbreakerCallsSucceededTotal()
default void incrementCircuitbreakerCallsFailedTotal()
default void incrementCircuitbreakerCallsPreventedTotal()
default void incrementCircuitbreakerOpenedTotal()
default void incrementBulkheadCallsAcceptedTotal()
default void incrementBulkheadCallsRejectedTotal()
default void addBulkheadExecutionDuration(long nanos)
nanos - Nanosecondsdefault void addBulkheadWaitingDuration(long nanos)
Asynchronousnanos - Nanosecondsdefault void incrementFallbackCallsTotal()
Copyright © 2021. All rights reserved.