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

com.pig4cloud.plugin.cache.metrics.RedisCaffeineCacheMeterBinderProvider Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package com.pig4cloud.plugin.cache.metrics;

import com.pig4cloud.plugin.cache.support.RedisCaffeineCache;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics;
import lombok.NoArgsConstructor;
import org.springframework.boot.actuate.metrics.cache.CacheMeterBinderProvider;

/**
 * RedisCaffeineCache meter
 *
 * @author L.cm
 */
@NoArgsConstructor
public class RedisCaffeineCacheMeterBinderProvider implements CacheMeterBinderProvider {

    @Override
    public MeterBinder getMeterBinder(RedisCaffeineCache cache, Iterable tags) {
        return new CaffeineCacheMetrics(cache.getCaffeineCache(), cache.getName(), tags);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy