views:

46

answers:

1

I am trying to monitor tomcat with the MBeanUtil class,I came accross the ResourceCache and its statistics.

what exactly does a resourcecache do?

I found few stats related to the Cache 1)hitsCount 2)accessCount 3) cacheSize

What does each of the above stats specify.

+1  A: 

The documentation states that ResourceCache implements a special purpose cache. As its name implies it is used for caching resources that are looked up through JNDI.

From the sources I see that accessCount is incremented every time a look up is performed. hitsCount is incremented every time a resource object is returned (it is not incremented when the resource isn't found). cacheSize is the size of the cache in KB.

kgiannakakis
what kind of resources does it contain... i looked at the statistics after restarting tomcat and i observed that the hitCount is equal to the number of hits i made to the web app, i was wondering if the hitCount always returns the total number of hits??
Sudheer
No, it isn't the number of application hits count. It is the number of resources hits count. You could add a JNDI resource in your application to test this.
kgiannakakis