From f151374afd5f0dab4250429d64361e36c4688b11 Mon Sep 17 00:00:00 2001 From: v-zhangjc9 Date: Mon, 6 May 2024 15:16:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(monitor):=20=E5=A2=9E=E5=8A=A0=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=BA=BF=E7=A8=8B=20=E8=BE=93=E5=87=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/monitor/metric/PulsarMetrics.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/service-monitor/src/main/java/com/lanyuanxiaoyao/service/monitor/metric/PulsarMetrics.java b/service-monitor/src/main/java/com/lanyuanxiaoyao/service/monitor/metric/PulsarMetrics.java index 482a6eb..66335a7 100644 --- a/service-monitor/src/main/java/com/lanyuanxiaoyao/service/monitor/metric/PulsarMetrics.java +++ b/service-monitor/src/main/java/com/lanyuanxiaoyao/service/monitor/metric/PulsarMetrics.java @@ -3,6 +3,7 @@ package com.lanyuanxiaoyao.service.monitor.metric; import cn.hutool.core.util.StrUtil; import com.lanyuanxiaoyao.service.common.Constants; import com.lanyuanxiaoyao.service.common.utils.NameHelper; +import com.lanyuanxiaoyao.service.configuration.ExecutorProvider; import com.lanyuanxiaoyao.service.configuration.HudiServiceProperties; import com.lanyuanxiaoyao.service.forest.service.InfoService; import com.lanyuanxiaoyao.service.forest.service.PulsarService; @@ -17,7 +18,6 @@ import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; -import static com.lanyuanxiaoyao.service.common.Constants.HALF_HOUR; import static com.lanyuanxiaoyao.service.common.Constants.MINUTE; /** @@ -47,11 +47,11 @@ public class PulsarMetrics extends Metrics { backlogMap = Maps.mutable.empty(); } - @Scheduled(fixedDelay = HALF_HOUR, initialDelay = MINUTE) + @Scheduled(fixedDelay = 10 * MINUTE, initialDelay = MINUTE) @Override void update() { infoService.tableMetaList() - // .asParallel(ExecutorProvider.EXECUTORS, 50) + .asParallel(ExecutorProvider.EXECUTORS, 2) .reject(meta -> StrUtil.isBlank(meta.getPulsarAddress())) .forEach(meta -> { try { @@ -74,7 +74,8 @@ public class PulsarMetrics extends Metrics { backlogCache.set(backlog); infoService.savePulsarBacklog(meta.getJob().getId(), meta.getAlias(), backlog); } - } catch (Exception ignored) { + } catch (Exception exception) { + logger.warn("Update pulsar backlog fail for " + meta.getAlias(), exception); } }); }