此内容没有您所选择的语言版本。
21.4. Enable JMX for Cache Instances
At the Cache level, JMX statistics can be enabled either declaratively or programmatically, as follows.
Enable JMX Declaratively at the Cache Level (Library mode)
Add the following snippet within either the <default> element for the default cache instance, or under the target <namedCache> element for a specific named cache:
<jmxStatistics enabled="true"/>
<jmxStatistics enabled="true"/>
Enable JMX Programmatically at the Cache Level (Library mode)
Add the following code to programmatically enable JMX at the cache level:
Configuration configuration = new ConfigurationBuilder().jmxStatistics().enable().build();
Configuration configuration = new
ConfigurationBuilder().jmxStatistics().enable().build();
Enable JMX Declaratively at the Cache Level (Remote Client-Server mode)
Add the following code to declaratively enable JMX at the cache level:
<local-cache name="default" start="EAGER" statistics="true">
<local-cache name="default" start="EAGER" statistics="true">
Note
To disable the JMX statistics in the Library mode, set the
enabled
property to "false"
and for Remote Client-Server mode, set the statistics
property to "false."