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

io.quarkus.cache.runtime.caffeine.metrics.NoOpMetricsInitializer Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.cache.runtime.caffeine.metrics;

import org.jboss.logging.Logger;

import com.github.benmanes.caffeine.cache.AsyncCache;

/**
 * An instance of this class is created during the instantiation of the Caffeine caches when the application does not depend on
 * any quarkus-micrometer-registry-* extension. It is required to make the micrometer-core dependency optional.
 */
public class NoOpMetricsInitializer implements MetricsInitializer {

    private static final Logger LOGGER = Logger.getLogger(NoOpMetricsInitializer.class);

    @Override
    public boolean metricsEnabled() {
        return false;
    }

    @Override
    public void recordMetrics(AsyncCache cache, String cacheName) {
        LOGGER.tracef("Initializing no-op metrics for cache [%s]", cacheName);
        // Do nothing more.
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy