com.pig4cloud.plugin.cache.metrics.RedisCaffeineCacheMeterBinderProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multilevel-cache-spring-boot-starter Show documentation
Show all versions of multilevel-cache-spring-boot-starter Show documentation
support L1 caffeine and L2 redis cache
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