I would like to be able to dynamically toggle the recording of stats of Caffeine Caches on demand via REST endpoint, or JMX Method
We have a large scale application where we use several instances of Caffeine Caches. We could use every possible performance upgrade, so having it in constant recording seems redundant. Especially if JavaDoc says recording has a performance cost. After my analysis I think it is not directly supported. Or is it?
I have 2 goals for stats, 1st one is to be able to tweak our caching strategy. To identify where we have terrible hit-rate, or where we actually don't need the cache. To accommodate this we could possibly do a temporary release with recording turned on and then do the final release. Meaning this solution would not be dynamic at all.
The 2nd goal would be to use it to identify cause of system failures. To diagnose erroneous state on a live production environment. To keep all my ideal requirements this would have to be dynamic. If I cannot change cache instance, I thought I could possibly replace the instance. This would bring huge temporal load on the system, since it would basically purge all caches.
To avoid purging we could maybe somehow pass on values cheaply to new instance with stats recording toggled. I don't yet know how, or if even possible.
So my question is what is the best way of achieving my goals?