gpt4 book ai didi

spring-boot - Spring Boot 2执行器指标缓存

转载 作者:行者123 更新时间:2023-12-02 02:51:32 24 4
gpt4 key购买 nike

我有一些缓存

@Service
@CacheConfig(cacheNames = "myCache")
public class MyService { ... }

@Service
@CacheConfig(cacheNames = "myOtherCache")
public class MyOtherService { ... }

我得到“/actuator/metrics/cache.gets”
{
"name" : "cache.gets",
"measurements" : [ {
"statistic" : "COUNT",
"value" : 5.0
} ],
"availableTags" : [ {
"tag" : "result",
"values" : [ "hit", "miss" ]
}, {
"tag" : "cache",
"values" : [ "myCache", "myOtherCache" ]
}, {
"tag" : "name",
"values" : [ "myCache", "myOtherCache" ]
}, {
"tag" : "cacheManager",
"values" : [ "cacheManager" ]
} ]
}

如何获取myCache和myOtherCache的命中和未命中值?

最佳答案

您应该按照此处的说明使用标签:http://blog.davidvassallo.me/2018/03/13/drill-down-into-spring-boot-actuator-metrics/

GET .../actuator/metrics/cache.gets?tag=name:myCache
GET .../actuator/metrics/cache.gets?tag=name:myOtherCache

关于spring-boot - Spring Boot 2执行器指标缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51972607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com