24.3.8.2. 为远程缓存容器启用统计信息
启用 statistics-enabled
属性可为给定的 remote-cache-container
和关联的运行时缓存启用指标集合。
-
对于名为"foo"的
remote-cache-container
,请使用以下操作启用统计信息:
/subsystem=infinispan/remote-cache-container=foo:write-attribute(name=statistics-enabled, value=true)
-
对于
remote-cache-container
"foo",在运行时可以看到以下指标:
/subsystem=infinispan/remote-cache-container=foo:read-attribute(name=connections) /subsystem=infinispan/remote-cache-container=foo:read-attribute(name=active-connections) /subsystem=infinispan/remote-cache-container=foo:read-attribute(name=idle-connections)
-
对于这些指标的描述,请对
remote-cache-container 执行 read-resource-
description 操作:
/subsystem=infinispan/remote-cache-container=foo:read-resource-description
- 以下指标特定于所选部署使用的远程缓存:
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:read-resource(include-runtime=true, recursive=true) { "average-read-time" : 1, "average-remove-time" : 0, "average-write-time" : 2, "hits" : 9, "misses" : 0, "near-cache-hits" : 7, "near-cache-invalidations" : 8, "near-cache-misses" : 9, "near-cache-size" : 1, "removes" : 0, "time-since-reset" : 82344, "writes" : 8 }
- 如需这些指标的描述,请对远程缓存执行 read-resource-description 操作:
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:read-resource-description
- 其中一些指标是计算的值(如 average-*),另一些则被截断,如命中和未命中。通过以下操作可以重置 tallied 指标:
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:reset-statistics()