package com.iailab.module.data.job.task;
|
|
import com.iailab.module.data.point.collection.PointCollector;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import javax.annotation.Resource;
|
import org.springframework.stereotype.Component;
|
|
import java.time.LocalDateTime;
|
import java.util.Calendar;
|
|
/**
|
* Point采集器KIO 10s
|
* 0/10 * * * * ?
|
*
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年06月13日
|
*/
|
@Component("pointCollectTaskNetKIO10")
|
public class PointCollectTaskNetKIO10 implements ITask {
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
private final String NET = "NET_KIO10";
|
|
@Resource
|
private PointCollector pointCollector;
|
|
@Override
|
public void run(String params){
|
// 0/10 * * * * ?
|
logger.debug("PointCollectTaskNetKIO10定时任务正在执行,参数为:{}", params);
|
try {
|
Calendar calendar = Calendar.getInstance();
|
calendar.set(Calendar.MILLISECOND, 0);
|
pointCollector.collect(calendar.getTime(), NET);
|
logger.info("PointCollectTaskNetKIO10定时任务完成时间:" + LocalDateTime.now());
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
logger.error("PointCollectTaskNetKIO10定时任务失败时间:" + LocalDateTime.now());
|
}
|
|
}
|
}
|