From 6250f7cd9a063b191dce816fa80cb37ffd75bcb2 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 29 Oct 2024 16:40:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-139097=20=E5=9B=BD=E9=99=85=E7=89=88?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=B1=8F=E8=94=BD=E5=AE=9A=E6=97=B6=E5=9B=9E?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/carton/latency/DesignerLatencyMetric.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java index 75fa28ef1e..189ef0136d 100644 --- a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java +++ b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java @@ -9,6 +9,7 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; import com.fr.general.GeneralUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; @@ -72,7 +73,7 @@ public class DesignerLatencyMetric { * 启动 */ public void start() { - if (SwitchForSwingChecker.isLatencyMonitoring()) { + if (needMonitor()) { // 初始化容器 initializeContainer(); // 启动异步性能记录线程池 @@ -95,7 +96,7 @@ public class DesignerLatencyMetric { * 关闭 */ public void stop() { - if (SwitchForSwingChecker.isLatencyMonitoring()) { + if (needMonitor()) { if (this.executorService != null) { this.executorService.shutdown(); } @@ -107,6 +108,11 @@ public class DesignerLatencyMetric { } } + private static boolean needMonitor() { + // 海外版本不回传云中心 + return SwitchForSwingChecker.isLatencyMonitoring() && GeneralContext.isChineseEnv(); + } + private String getLatencyUrl() { if (StringUtils.isEmpty(latencyUrl)) { String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint");