【问题标题】:How to fetch infinispan cache statistics in wildfly?如何在wildfly中获取infinispan缓存统计信息?
【发布时间】:2021-01-12 16:48:43
【问题描述】:

我正在尝试使用 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>

【问题讨论】:

    标签: java hibernate caching wildfly infinispan


    【解决方案1】:

    “resolve-expressions=true”似乎有帮助:

    /subsystem=infinispan/cache-container=hibernate/local-cache=entity/:read-attribute(name=number-of-entries,resolve-expressions=true,include-defaults=false)
    {
    "outcome" => "success",
    "result" => undefined
    }
    

    这与我在 jConsole -> WidlFly CLI 选项卡中看到的一致。 但是这条路径不会产生我可以在 MBeans 选项卡中看到的真正的 Hibernate 统计信息,因此它不能完全回答您的问题。

    【讨论】:

      猜你喜欢
      • 2016-08-16
      • 1970-01-01
      • 1970-01-01
      • 2012-07-22
      • 2019-06-15
      • 2016-09-17
      • 2015-12-13
      • 1970-01-01
      • 2011-04-29
      相关资源
      最近更新 更多