Following this blog post about implementing a Caffeine async cache, we wanted to get the statistical data from the cache.
We are using version 2.7.0
of Caffeine
However, it seems that the AsyncCache
has no access to its statistics:
private AsyncCache<String, Cat> asyncCache = Caffeine.newBuilder()
.expireAfterWrite(1, TimeUnit.HOURS)
.recordStats()
.maximumSize(100)
.buildAsync();
private Cache<String, Cat> cache = Caffeine.newBuilder()
.expireAfterWrite(1, TimeUnit.HOURS)
.maximumSize(100)
.recordStats()
.build();
....
cache.stats(); // this is possible
asyncCache.stats(); // no such method in asyncCache
Also, when checking the source code of the AsyncCache and comparing it to the Cache class, there is no stats()
method in the async class.
Is there a reason for that?