Class NoOpMetrics
java.lang.Object
io.github.teceli.resiliencia.metrics.NoOpMetrics
- All Implemented Interfaces:
ResilienceMetrics
A no-op
ResilienceMetrics implementation that discards all recordings. Used by default
when no backend is configured, to avoid null-checking or forcing consumers to provide a metrics
implementation they may not need.
Thread-safe and lock-free. Suitable for use as a default or when metrics are deliberately disabled.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NoOpMetricsSingleton instance of the no-op metrics implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoidObserve a counter/timer-worthy occurrence from any pattern (Retry, Timeout, CircuitBreaker, Bulkhead, RateLimiter) or from Policy's order validation.voidObserve a gauge-worthy snapshot of live state from CircuitBreaker, Bulkhead, or RateLimiter.
-
Field Details
-
INSTANCE
Singleton instance of the no-op metrics implementation.
-
-
Method Details
-
observe
Description copied from interface:ResilienceMetricsObserve a gauge-worthy snapshot of live state from CircuitBreaker, Bulkhead, or RateLimiter.- Specified by:
observein interfaceResilienceMetrics- Parameters:
snapshot- the snapshot to observe; never null
-
observe
Description copied from interface:ResilienceMetricsObserve a counter/timer-worthy occurrence from any pattern (Retry, Timeout, CircuitBreaker, Bulkhead, RateLimiter) or from Policy's order validation.- Specified by:
observein interfaceResilienceMetrics- Parameters:
counters- the counter event to observe; never null
-