spring - 是否有提供者不可知的方式来获取 Spring 框架中的最新缓存统计信息?

标签 spring caching statistics abstraction

Spring提供了一个有用的特性Cache Abstraction
但我找不到的是 提供者不可知论获取实时缓存统计信息的方法。本质上,我只想在网页上或通过 JMX 显示所有缓存名称及其对应键的列表以及命中、未命中和大小(以 kb 为单位)的计数。我知道 Ehcache 确实提供了这个功能,如果我使用 ehcache API在代码中我可以得到它(过去已经使用过它)。但我相信在代码中使用 Ehcache API 会消除 Spring 框架缓存抽象的整个概念。

最佳答案

您拥有的唯一常见的、与提供者无关的东西是 CacheManager接口(interface),提供如下方法:

Collection<String> getCacheNames() 

它返回缓存管理器已知的缓存集合。

关于spring - 是否有提供者不可知的方式来获取 Spring 框架中的最新缓存统计信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5316494/

相关文章:

python - 类型错误 :ndarray not callable in scipy. stats.kstest()

python - 如何生成沿每个轴具有不同方差的随机高斯矩阵

Spring - 如何知道cglib或jdk动态代理是否应用于bean

jsp - Tomcat 7 不同的行为

php - file_get_contents 对 'https://en.wikipedia.org/wiki/Category:Upcoming_singles' 的变量响应

Symfony 在 Web 文件夹中缓存 Twig 模板

python - 如何使用 statsmodels 执行 2-way 重复测量方差分析?

spring - 如何将 Kerberos 票证传递给 Spring Yarn 应用程序

spring - 在 Spring Boot 2 中使用 Quartz

java - 如何更改自动生成的 SOAP :address from a JAX-WS webservice WSDL deployed with Spring