Created
May 8, 2022 12:09
-
-
Save sirech/7939d5916b35b2ac771f7ccd8f68ae6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static <R> Cache<String, R> cache(String name, MeterRegistry meterRegistry) { | |
Cache<String, R> cache = Caffeine.newBuilder() | |
.recordStats() | |
.expireAfterWrite(Duration.ofHours(24)) | |
.maximumSize(6000) | |
.build(); | |
CaffeineCacheMetrics.monitor(meterRegistry, cache, name); | |
return cache; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment