All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.faulttolerance.standalone.NoopAdapter Maven / Gradle / Ivy

There is a newer version: 6.4.1
Show newest version
package io.smallrye.faulttolerance.standalone;

import io.smallrye.faulttolerance.core.metrics.MeteredOperation;
import io.smallrye.faulttolerance.core.metrics.MetricsProvider;
import io.smallrye.faulttolerance.core.metrics.MetricsRecorder;

public final class NoopAdapter implements MetricsAdapter {
    public static final NoopAdapter INSTANCE = new NoopAdapter();

    private NoopAdapter() {
    }

    MetricsProvider createMetricsProvider() {
        return new MetricsProvider() {
            @Override
            public boolean isEnabled() {
                return false;
            }

            @Override
            public MetricsRecorder create(MeteredOperation operation) {
                return MetricsRecorder.NOOP;
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy