Spring Boot 2 执行器指标缓存 [英] Spring Boot 2 Actuator Metrics Cache
本文介绍了Spring Boot 2 执行器指标缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些缓存
@Service
@CacheConfig(cacheNames = "myCache")
public class MyService { ... }
@Service
@CacheConfig(cacheNames = "myOtherCache")
public class MyOtherService { ... }
我得到/actuator/metrics/cache.gets"
I get with "/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 的命中和未命中值?
how can I obtain the hit and miss values for myCache and myOtherCache?
推荐答案
你应该使用这里解释的标签:http://blog.davidvassallo.me/2018/03/13/drill-down-into-spring-boot-actuator-metrics/
You should use the tags as explained here : 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 2 执行器指标缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文