diff --git a/changelog/@unreleased/pr-2003.v2.yml b/changelog/@unreleased/pr-2003.v2.yml new file mode 100644 index 000000000..2488e26c0 --- /dev/null +++ b/changelog/@unreleased/pr-2003.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Deprecate CaffeineCacheStats.registerCache + links: + - https://github.com/palantir/tritium/pull/2003 diff --git a/tritium-caffeine/src/main/java/com/palantir/tritium/metrics/caffeine/CaffeineCacheStats.java b/tritium-caffeine/src/main/java/com/palantir/tritium/metrics/caffeine/CaffeineCacheStats.java index 6cdf205fb..fccbfe4e1 100644 --- a/tritium-caffeine/src/main/java/com/palantir/tritium/metrics/caffeine/CaffeineCacheStats.java +++ b/tritium-caffeine/src/main/java/com/palantir/tritium/metrics/caffeine/CaffeineCacheStats.java @@ -78,9 +78,11 @@ public static void registerCache(MetricRegistry registry, Cache cache, Str * @param cache cache to instrument * @param name cache name *

- * Soon to be deprecated, prefer {@link Caffeine#recordStats(Supplier)} and {@link CacheStats#of(TaggedMetricRegistry, String)} + * @deprecated Prefer {@link CacheStats#of(TaggedMetricRegistry, String)}.{@link CacheStats#register(Function) register(stats ->} {@link Caffeine#recordStats(Supplier) Caffeine.newBuilder().recordStats(stats)}}... + *

+ * See Instrumenting a [Caffeine cache](https://github.com/ben-manes/caffeine/) */ - // Soon to be @Deprecated + @Deprecated public static void registerCache(TaggedMetricRegistry registry, Cache cache, @Safe String name) { checkNotNull(registry, "registry"); checkNotNull(cache, "cache");