简体   繁体   English

Tomcat的ResourceCache有什么作用? hitsCount和accessCount有什么区别?

[英]What does tomcat's ResourceCache Do? What is the difference between hitsCount and accessCount?

I am trying to monitor tomcat with the MBeanUtil class,I came accross the ResourceCache and its statistics. 我试图用MBeanUtil类监视tomcat,我遇到了ResourceCache及其统计信息。

what exactly does a resourcecache do? 资源缓存到底是做什么的?

I found few stats related to the Cache 1)hitsCount 2)accessCount 3) cacheSize 我发现与缓存1)hitsCount 2)accessCount 3)cacheSize相关的一些统计信息

What does each of the above stats specify. 上述每个统计信息指定了什么。

The documentation states that ResourceCache implements a special purpose cache. 文档指出ResourceCache实现了专用缓存。 As its name implies it is used for caching resources that are looked up through JNDI. 顾名思义,它用于缓存通过JNDI查找的资源。

From the sources I see that accessCount is incremented every time a look up is performed. 从源中可以看到,每次执行查找时,accessCount都会增加。 hitsCount is incremented every time a resource object is returned (it is not incremented when the resource isn't found). 每次返回资源对象时,hitsCount都会增加(当找不到资源时,它不会增加)。 cacheSize is the size of the cache in KB. cacheSize是缓存的大小,以KB为单位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM