Метрики кэша привода Spring boot 2 - PullRequest
0 голосов
/ 28 мая 2020

Я не могу найти метрики кеша в приводе sprint boot 2. Как мне запросить, активировать или отладить их? *http://localhost: 8080 / actator / caches ->

{
  "cacheManagers": {
    "cacheManager": {
      "caches": {
        "calendar": {
          "target": "org.ehcache.jsr107.Eh107Cache"
        },
        "foo": {
          "target": "org.ehcache.jsr107.Eh107Cache"
        }
      }
    }
  }
}

ehcache. xml:


<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>

Я не вижу ни кеша, ни календаря, ни foo под http://localhost: 8080 / actator / metrics / (видны другие показатели, такие как «jvm.memory.max»)

аналогично

http://localhost : 8080 / actator / metrics / cache.calendar.size

http://localhost: 8080 / actator / metrics / cache.calendar.gets

http://localhost: 8080 // actator / metrics / cache.gets

ничего не возвращает.

Как получить метрики кеша?

http://localhost: 8080 / actator / metrics / cache? Tag = calendar: size тоже ничего не возвращает, а в журналах я вижу:

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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...