|
@@ -25,26 +25,38 @@ public class GatherScheduler {
|
|
|
|
|
|
private final static Logger logger = LoggerFactory.getLogger(GatherScheduler.class);
|
|
|
|
|
|
+ private static int scheNum=1; //执行次数
|
|
|
+
|
|
|
+ public static void resetScheNum() {
|
|
|
+ scheNum=1;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static int getScheNum() {
|
|
|
+ return scheNum;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 单值1分钟执行一次采集
|
|
|
*/
|
|
|
@Scheduled(fixedRate=60*1000) //每分钟执行一次
|
|
|
public void startSingleGather() {
|
|
|
- logger.info("单值定时采集启动...");
|
|
|
+ logger.info("定时采集启动...");
|
|
|
Iterator<Channel> iterator=ChannelGroupMgr.iterator();
|
|
|
Channel channel=null;
|
|
|
while(iterator.hasNext()) {
|
|
|
channel=iterator.next();
|
|
|
- GatherTaskExecutor.execute(new GatherSingleTask(channel));
|
|
|
+ GatherTaskExecutor.execute(new GatherTask(channel));
|
|
|
}
|
|
|
+
|
|
|
+ scheNum+=1;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 多值3分钟执行一次采集,首次延时30s
|
|
|
*/
|
|
|
- @Scheduled(fixedRate = 300 * 1000,initialDelay= 30000)
|
|
|
+ //@Scheduled(fixedRate = 300 * 1000,initialDelay= 30000)
|
|
|
public void startMultiGather() {
|
|
|
logger.info("多值定时采集启动...");
|
|
|
Iterator<Channel> iterator=ChannelGroupMgr.iterator();
|