From 6cf423172cd2fb5baf6ff78b554da5ac5b888389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=84=E9=B8=BF?= Date: Tue, 20 Feb 2024 20:16:51 +0800 Subject: [PATCH 1/2] fix: fix monitorinstance in supercacheservice --- .../server/common/service/SuperCacheService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java b/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java index a21bc8101..db0be79b3 100644 --- a/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java +++ b/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java @@ -20,8 +20,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; /** * @@ -53,13 +51,16 @@ public void load() throws Exception { ProdLog.info("[SuperCache] load start"); SuperCache sc = new SuperCache(); sc.metaDataDictValueMap = metaDictValueService.getMetaDictValue(); + ProdLog.info("[SuperCache][metaDataDictValueMap] size: " + sc.metaDataDictValueMap.size()); sc.expressionMetricList = metricInfoService.querySpmList(); + ProdLog.info("[SuperCache][expressionMetricList] size: " + sc.expressionMetricList.size()); sc.workspaceTenantMap = new HashMap<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("deleted", false); + queryWrapper.eq("deleted", 0); List instances = monitorInstanceService.list(queryWrapper); instances.forEach( - instance -> sc.workspaceTenantMap.put(instance.getWorkspace(), instance.getTenant())); + instance -> sc.workspaceTenantMap.put(instance.getWorkspace(), instance.getTenant())); + ProdLog.info("[SuperCache][workspaceTenantMap] size: " + sc.workspaceTenantMap.size()); queryMetricInfoByPage(sc); this.sc = sc; ProdLog.info("[SuperCache] load end"); @@ -97,14 +98,16 @@ private void queryMetricInfoByPage(SuperCache sc) { } map.put(metricInfo.getMetricTable(), metricInfo); if (StringUtils.isNotBlank(metricInfo.getWorkspace()) - && !StringUtils.equals(metricInfo.getWorkspace(), "-")) { + && !StringUtils.equals(metricInfo.getWorkspace(), "-")) { List list = - workspaceMap.computeIfAbsent(metricInfo.getWorkspace(), k -> new ArrayList<>()); + workspaceMap.computeIfAbsent(metricInfo.getWorkspace(), k -> new ArrayList<>()); list.add(metricInfo); } } } while (current < 1000); sc.metricInfoMap = map; sc.workspaceMetricInfoMap = workspaceMap; + ProdLog.info("[SuperCache][metricInfoMap] size: " + sc.metricInfoMap.size()); + ProdLog.info("[SuperCache][workspaceMetricInfoMap] size: " + sc.workspaceMetricInfoMap.size()); } } From 282dec9fb7632c61eb6dfe88366f6dbb4f0940cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=84=E9=B8=BF?= Date: Tue, 20 Feb 2024 20:20:15 +0800 Subject: [PATCH 2/2] fix: fix format --- .../server/common/service/SuperCacheService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java b/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java index db0be79b3..f9477d566 100644 --- a/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java +++ b/server/common/common-service/src/main/java/io/holoinsight/server/common/service/SuperCacheService.java @@ -59,7 +59,7 @@ public void load() throws Exception { queryWrapper.eq("deleted", 0); List instances = monitorInstanceService.list(queryWrapper); instances.forEach( - instance -> sc.workspaceTenantMap.put(instance.getWorkspace(), instance.getTenant())); + instance -> sc.workspaceTenantMap.put(instance.getWorkspace(), instance.getTenant())); ProdLog.info("[SuperCache][workspaceTenantMap] size: " + sc.workspaceTenantMap.size()); queryMetricInfoByPage(sc); this.sc = sc; @@ -98,9 +98,9 @@ private void queryMetricInfoByPage(SuperCache sc) { } map.put(metricInfo.getMetricTable(), metricInfo); if (StringUtils.isNotBlank(metricInfo.getWorkspace()) - && !StringUtils.equals(metricInfo.getWorkspace(), "-")) { + && !StringUtils.equals(metricInfo.getWorkspace(), "-")) { List list = - workspaceMap.computeIfAbsent(metricInfo.getWorkspace(), k -> new ArrayList<>()); + workspaceMap.computeIfAbsent(metricInfo.getWorkspace(), k -> new ArrayList<>()); list.add(metricInfo); } }