feat: open jraft-node metrics

This commit is contained in:
chuntaojun 2020-05-13 17:17:59 +08:00
parent 4d4e914ebd
commit b6e5d9cc31

View File

@ -129,6 +129,15 @@ public class JRaftServer {
private int failoverRetries;
private int rpcRequestTimeoutMs;
static {
// Set bolt buffer
// System.getProperties().setProperty("bolt.channel_write_buf_low_water_mark", String.valueOf(64 * 1024 * 1024));
// System.getProperties().setProperty("bolt.channel_write_buf_high_water_mark", String.valueOf(256 * 1024 * 1024));
System.getProperties().setProperty("bolt.netty.buffer.low.watermark", String.valueOf(128 * 1024 * 1024));
System.getProperties().setProperty("bolt.netty.buffer.high.watermark", String.valueOf(256 * 1024 * 1024));
}
public JRaftServer(final int failoverRetries) throws Exception {
this.failoverRetries = failoverRetries;
this.conf = new Configuration();
@ -164,6 +173,8 @@ public class JRaftServer {
nodeOptions.setElectionTimeoutMs(electionTimeout);
RaftOptions raftOptions = RaftOptionsBuilder.initRaftOptions(raftConfig);
nodeOptions.setRaftOptions(raftOptions);
// open jraft node metrics record function
nodeOptions.setEnableMetrics(true);
CliOptions cliOptions = new CliOptions();