Class MetricsCollector<V>
- java.lang.Object
-
- io.smallrye.faulttolerance.core.metrics.MetricsCollector<V>
-
- All Implemented Interfaces:
FaultToleranceStrategy<V>
- Direct Known Subclasses:
CompletionStageMetricsCollector
public class MetricsCollector<V> extends Object implements FaultToleranceStrategy<V>
-
-
Constructor Summary
Constructors Constructor Description MetricsCollector(FaultToleranceStrategy<V> delegate, MetricsRecorder metrics, MeteredOperation operation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vapply(InvocationContext<V> ctx)Apply the fault tolerance strategy around the targetCallable.protected voidregisterMetrics(InvocationContext<V> ctx)
-
-
-
Constructor Detail
-
MetricsCollector
public MetricsCollector(FaultToleranceStrategy<V> delegate, MetricsRecorder metrics, MeteredOperation operation)
-
-
Method Detail
-
apply
public V apply(InvocationContext<V> ctx) throws Exception
Description copied from interface:FaultToleranceStrategyApply the fault tolerance strategy around the targetCallable. TheCallableis wrapped in anInvocationContext.- Specified by:
applyin interfaceFaultToleranceStrategy<V>- Parameters:
ctx- theInvocationContextwrapping theCallableguarded by this fault tolerance strategy- Returns:
- result computed by the target
Callable - Throws:
Exception- if result couldn't be computed
-
registerMetrics
protected final void registerMetrics(InvocationContext<V> ctx)
-
-