管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-24 c5c14c9ed07290c283fd04e7463e0f8fa01ae402
1
已修改1个文件
29 ■■■■■ 文件已修改
src/main/java/com/lf/server/config/ScheduleConfig.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 = 30 * 1000)
    public void checkSystemStatus() {
        try {
            JSONObject jsonObject = new JSONObject();
@@ -58,4 +58,29 @@
            log.error(ex.getMessage(), ex);
        }
    }
    @Scheduled(fixedRate = 60 * 1000)
    public void countSystemStatus() {
        // noinspection AlibabaRemoveCommentedCode
        try {
            JSONObject jsonObject = new JSONObject();
            // 服务使用状态 sys_res
            // jsonObject.put("resUseCount", scheduleService.resUseCount());
            // 用户登录状态 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);
        }
    }
}