From 2e595378662cca688f903ea9a83752c6c8e310b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=88=9A?= <53732908@qq.com> Date: Wed, 12 Feb 2025 16:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=BC=93=E5=AD=98=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=A2=9E=E5=8A=A0=E5=90=84=E7=A7=8D?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/service/cache/LocalCacheService.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ddp/ddp-common/ddp-service/src/main/java/com/fibo/ddp/common/service/cache/LocalCacheService.java b/ddp/ddp-common/ddp-service/src/main/java/com/fibo/ddp/common/service/cache/LocalCacheService.java index 990d1f7..3b90764 100644 --- a/ddp/ddp-common/ddp-service/src/main/java/com/fibo/ddp/common/service/cache/LocalCacheService.java +++ b/ddp/ddp-common/ddp-service/src/main/java/com/fibo/ddp/common/service/cache/LocalCacheService.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; +import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -59,6 +60,9 @@ public class LocalCacheService { @Resource PMMLExecutor pmmlExecutor; + private static final String VERSION = "2025-02-12 16:30"; + private final String startTime = LocalDateTime.now().toString(); + @@ -86,6 +90,9 @@ public class LocalCacheService { public Map getInfo(){ Map info = new HashMap<>(); + info.put("VERSION",VERSION); + info.put("startTime",startTime); + info.put("runCount",runCount.longValue()); info.put("info",infoMap); @@ -149,6 +156,7 @@ public class LocalCacheService { updateFieldsCache(); }catch(Throwable e){ error = true; + infoMap.put("updateFieldsCache_error",LocalDateTime.now()+":"+e); logger.error("updateFieldsCache_error",e); } @@ -156,6 +164,7 @@ public class LocalCacheService { updateModelCache(); }catch(Throwable e){ error = true; + infoMap.put("updateModelCache_error",LocalDateTime.now()+":"+e); logger.error("updateModelCache_error",e); } if(throwsError && error){ @@ -188,11 +197,19 @@ public class LocalCacheService { } CommUtil.doSleep(UPDATE_SLEEP_TIME_MS); runCount.getAndIncrement(); + long start = System.currentTimeMillis(); updateAllCache(false); + long end = System.currentTimeMillis(); + long time = end - start; + infoMap.put("updateAllCache_use_time",time+"MS"); + infoMap.put("updateAllCache_time",LocalDateTime.now().toString()); + } } } + + }