启用 Hot Rod 客户端统计信息,包括 remote 和 near-cache hits 和 misses,以及连接池使用情况。
流程
使用 StatisticsConfigurationBuilder 类来启用和配置 Hot Rod 客户端统计信息。
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.statistics().enable()
//Register JMX MBeans for RemoteCacheManager and each RemoteCache.
.jmxEnable()
//Set the JMX domain name to which MBeans are exposed.
.jmxDomain("org.example")
.addServer()
.host("127.0.0.1")
.port(11222);
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build());
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.statistics().enable()
//Register JMX MBeans for RemoteCacheManager and each RemoteCache.
.jmxEnable()
//Set the JMX domain name to which MBeans are exposed.
.jmxDomain("org.example")
.addServer()
.host("127.0.0.1")
.port(11222);
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build());
Copy to ClipboardCopied!Toggle word wrapToggle overflow