如何在Wildfly中获取infinispan缓存统计信息?

时间:2020-09-26 15:42:56

标签: java hibernate caching wildfly infinispan

我正在尝试使用jboss-cli获取统计信息

[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=hibernate/local-cache=entity:read-attribute(name=statistics-enabled) 
{
    "outcome" => "success",
    "result" => true
}

看起来不错,但所有实际统计信息属性都不会返回值。

[standalone@localhost:9990 /] /subsystem=infinispan/cache-container=hibernate/local-cache=entity:read-attribute(name=number-of-entries)
{"outcome" => "success"}

persistence.xml中的配置为:

<property name="hibernate.generate_statistics" value="true" />
<property name="hibernate.cache.infinispan.statistics" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true" />

和在standalone.xml中:

<cache-container name="hibernate" module="org.infinispan.hibernate-cache" statistics-enabled="true">
  <local-cache name="entity" statistics-enabled="true">
    <transaction locking="OPTIMISTIC" mode="NON_XA"/>
    <object-memory size="10000"/>
    <expiration max-idle="100000"/>
  </local-cache>
<!-- ... -->
</cache-container>

0 个答案:

没有答案