perf: 优化运维心跳告警
parent
85218039ae
commit
517df2d7a7
@ -1,19 +1,36 @@
|
|||||||
package com.shxy.xymanager_framework.timeTask;
|
package com.shxy.xymanager_framework.timeTask;
|
||||||
|
|
||||||
|
import com.shxy.xymanager_common.zhiping.PulliceModel;
|
||||||
import com.shxy.xymanager_service.service.NewCacheService;
|
import com.shxy.xymanager_service.service.NewCacheService;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ClearCacheTask {
|
public class ClearCacheTask {
|
||||||
|
|
||||||
|
public static HashMap<Integer, Long> warnMap = new HashMap<>();
|
||||||
|
public static HashMap<String, Long> heartbeatMap = new HashMap<>();
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
NewCacheService newCacheService;
|
NewCacheService newCacheService;
|
||||||
|
|
||||||
@Scheduled(cron = "0 0 3 * * ?")
|
@Scheduled(cron = "0 0 3 * * ?")
|
||||||
private void clear() {
|
private void clearOneDayStat() {
|
||||||
newCacheService.clearOneDayStat();
|
newCacheService.clearOneDayStat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 9,13 * * MON-FRI")
|
||||||
|
private void clearWarnMap() {
|
||||||
|
warnMap.clear();
|
||||||
|
heartbeatMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 9 * * ?")
|
||||||
|
private void clearFubin() {
|
||||||
|
PulliceModel.fubinDoneMap.clear();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue