Browse Source

Merge pull request #15278 in DESIGN/design from bugfix/11.0 to feature/x

* commit '4c3cbcb305bcd5f796c095fbde4ecfa57ccddb5f':
  REPORT-139097 国际版版本屏蔽定时回传
  REPORT-139097 国际版版本屏蔽定时回传
feature/x
superman 3 weeks ago
parent
commit
00f2ae9570
  1. 11
      designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java

11
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.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
@ -19,6 +20,7 @@ import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.WorkspaceEvent;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -72,7 +74,7 @@ public class DesignerLatencyMetric {
* 启动 * 启动
*/ */
public void start() { public void start() {
if (SwitchForSwingChecker.isLatencyMonitoring()) { if (needMonitor()) {
// 初始化容器 // 初始化容器
initializeContainer(); initializeContainer();
// 启动异步性能记录线程池 // 启动异步性能记录线程池
@ -95,7 +97,7 @@ public class DesignerLatencyMetric {
* 关闭 * 关闭
*/ */
public void stop() { public void stop() {
if (SwitchForSwingChecker.isLatencyMonitoring()) { if (needMonitor()) {
if (this.executorService != null) { if (this.executorService != null) {
this.executorService.shutdown(); this.executorService.shutdown();
} }
@ -107,6 +109,11 @@ public class DesignerLatencyMetric {
} }
} }
private static boolean needMonitor() {
// 海外版本不回传云中心
return SwitchForSwingChecker.isLatencyMonitoring() && Locale.CHINA.equals(GeneralContext.getLocale());
}
private String getLatencyUrl() { private String getLatencyUrl() {
if (StringUtils.isEmpty(latencyUrl)) { if (StringUtils.isEmpty(latencyUrl)) {
String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint"); String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint");

Loading…
Cancel
Save