| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 60 * 1000) |
| | | @Scheduled(fixedRate = 30 * 1000) |
| | | public void checkSystemStatus() { |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 30 * 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); |
| | | } |
| | | } |
| | | } |