public void init() {
try {
if (config.isJMXEnabled()) {
jmxReporter = JmxReporter.forRegistry(metrics).build();
jmxReporter.start();
}
if (config.isAutoShutDown()) {
autoShutDownScheduler
.scheduleWithFixedDelay(this::shutDown, delayInSecs, delayInSecs, SECONDS);
}
logger.info("Initializing StatCollector file : " + statFileName);
statChannel = FileChannel.open(Paths.get(statFileName), CREATE, WRITE);
} catch (IOException e) {
logger.error("Error while creating stat file " + statFileName, e);
}
rsyncFailed = metrics.meter(name(INDUCTOR, "rsyncFailure"));
woFailed = metrics.meter(name(INDUCTOR, "woFailure"));
format = new DecimalFormat();
format.setMaximumFractionDigits(2);
statScheduler
.scheduleWithFixedDelay(this::writeStat, delayInSecs, delayInSecs, SECONDS);
}
StatCollector.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:oneops
作者:
评论列表
文章目录