As part of performance testing, we are looking for a tool or simpler a JSP page to monitor all the caches in the JVM. We would also like to know some cache metrics for the cache, the ones we could think of are : -Number of cache entries present (in memory and in disk) -Free and available memory for each cache -Number of cache hits -Invalidations (number of invalidations with out getting hit at least for x times)
I worked with a cache interface that was was implemented as a wrapper for a Map - get, put, remove, etc. I made a special InstrumentedCache version that maintains internal counters for puts, gets, misses, removal by a CacheCleaner, and so on. It also kept a static List of all instances of the cache so it was easy for a jsp (or whatever) to iterate the list and dump the counters. Is that the kind of thing you have in mind?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi