From 15375a1d0d07c61c132906ff8da45f67bcd711f6 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 17 十一月 2022 15:51:05 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/config/ScheduleConfig.java |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/lf/server/config/ScheduleConfig.java b/src/main/java/com/lf/server/config/ScheduleConfig.java
index 3a90575..e35b633 100644
--- a/src/main/java/com/lf/server/config/ScheduleConfig.java
+++ b/src/main/java/com/lf/server/config/ScheduleConfig.java
@@ -23,7 +23,7 @@
 
     private static final Log log = LogFactory.getLog(ScheduleConfig.class);
 
-    @Scheduled(fixedRate = 15 * 1000)
+    @Scheduled(fixedRate = 10 * 1000)
     public void pushMonitorInfo() {
         try {
             JSONObject jsonObject = new JSONObject();
@@ -43,7 +43,7 @@
         }
     }
 
-    @Scheduled(fixedRate = 60 * 1000)
+    @Scheduled(fixedRate = 20 * 1000)
     public void checkSystemStatus() {
         try {
             JSONObject jsonObject = new JSONObject();
@@ -58,4 +58,29 @@
             log.error(ex.getMessage(), ex);
         }
     }
+
+    @Scheduled(fixedRate = 40 * 1000)
+    public void countSystemStatus() {
+        // noinspection AlibabaRemoveCommentedCode
+        try {
+            JSONObject jsonObject = new JSONObject();
+
+            // 鏈嶅姟璧勬簮鐘舵�� sys_res
+            jsonObject.put("resUseCount", scheduleService.countResStatus());
+
+            // 鐢ㄦ埛鐧诲綍鐘舵�� sys_login
+             jsonObject.put("userLoginCount", scheduleService.userLoginCount());
+
+            // 璧勬簮鎿嶄綔鐘舵�� sys_operate
+            jsonObject.put("operateCount", scheduleService.operateCount());
+
+            // 璧勬簮璋冪敤鐘舵��
+
+            String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
+
+            WebSocketService.broadCastInfo(json);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+        }
+    }
 }

--
Gitblit v1.9.3