【问题标题】:Spring metrics don't show Guava hit/missSpring 指标不显示 Guava 命中/未命中
【发布时间】:2017-10-03 14:16:53
【问题描述】:

在指标端点中,我得到了所有缓存大小,但没有命中/未命中(正如 https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html#production-ready-datasource-cache 所预期的那样)

示例: "cache.mytest.size":19

我还预计命中/未命中计数器... 我正在使用番石榴。

【问题讨论】:

    标签: spring google-guava-cache


    【解决方案1】:

    必须在每个缓存的基础上启用它们:

    https://github.com/google/guava/wiki/CachesExplained#statistics

    cacheBuilder.recordStats();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-26
      • 1970-01-01
      • 1970-01-01
      • 2021-08-27
      • 2019-02-27
      • 1970-01-01
      相关资源
      最近更新 更多