Spring boot 2执行器缓存度量
我在sprint boot 2中找不到缓存指标。我应该如何查询、激活或调试它们 org.springframework.boot:springbootstarteractuator:2.2.5.RELEASE 我可以在下面看到两个缓存 -> ehcache.xml:Spring boot 2执行器缓存度量,spring,spring-boot,ehcache,spring-boot-actuator,Spring,Spring Boot,Ehcache,Spring Boot Actuator,我在sprint boot 2中找不到缓存指标。我应该如何查询、激活或调试它们 org.springframework.boot:springbootstarteractuator:2.2.5.RELEASE 我可以在下面看到两个缓存 -> ehcache.xml: <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ehcache.org/v3"
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ehcache.org/v3"
xmlns:jsr107="http://www.ehcache.org/v3/jsr107"
xsi:schemaLocation="
http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd">
<cache alias="calendar" >
<expiry>
<ttl unit="seconds">60</ttl>
</expiry>
<resources>
<heap unit="entries">2</heap>
<offheap unit="MB">100</offheap>
</resources>
</cache>
<cache alias="foo" >
<expiry>
<ttl unit="seconds">60</ttl>
</expiry>
<resources>
<heap unit="entries">2</heap>
<offheap unit="MB">100</offheap>
</resources>
</cache>
</config>
在缓存配置中,可以启用统计信息:
<cache alias="calendar" >
...
<jsr107:mbeans enable-statistics="true" />
</cache>
...
@DanielJacob它不是重复的,/exactor/metrics/cache.get不会为我返回任何内容,这与在那篇文章中不同,你需要使用标记来过滤指标。因此,它将是这样的:@DanielJacob没有返回任何内容,我已经更新了我的问题,并包含了有关此查询的日志
2020-05-28 15:57:35.207 DEBUG 12490 --- [nio-8080-exec-3] org.apache.tomcat.util.http.Parameters : Decoding query null UTF-8
2020-05-28 15:57:35.207 DEBUG 12490 --- [nio-8080-exec-3] org.apache.tomcat.util.http.Parameters : Start processing with input [tag=calendar:size]
2020-05-28 15:57:35.207 DEBUG 12490 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : GET "/actuator/metrics/cache?tag=calendar:size", parameters={masked}
2020-05-28 15:57:35.207 DEBUG 12490 --- [nio-8080-exec-3] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped to Actuator web endpoint 'metrics-requiredMetricName'
2020-05-28 15:57:35.208 DEBUG 12490 --- [nio-8080-exec-3] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/vnd.spring-boot.actuator.v3+json;q=0.8', given [text/html, application/xhtml+xml, image/webp, application/xml;q=0.9, */*;q=0.8] and supported [application/vnd.spring-boot.actuator.v3+json, application/vnd.spring-boot.actuator.v2+json, application/json]
2020-05-28 15:57:35.209 DEBUG 12490 --- [nio-8080-exec-3] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2020-05-28 15:57:35.209 DEBUG 12490 --- [nio-8080-exec-3] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally
<cache alias="calendar" >
...
<jsr107:mbeans enable-statistics="true" />
</cache>