Authored by qinchao

日志打印:app_collect_sample取改为cron方式

... ... @@ -50,11 +50,12 @@ public class NewTask implements Runnable{
long todayStartMills = todayStart.getTimeInMillis();
//System.out.println(todayStartMills);
/* if("app_collect_sample".equals(taskModel.getDatabase())&&taskModel.getInfluxSql()!=null&&taskModel.getInfluxSql().indexOf("network_30s")>0){
scheduledFuture = taskScheduler.scheduleAtFixedRate(singleTask, new Date(todayStartMills), taskModel.getInterval() * 60 * 1000);
}else{*/
if("app_collect_sample".equals(taskModel.getDatabase())&&taskModel.getInfluxSql()!=null&&taskModel.getInfluxSql().indexOf("network_30s")>0){
//scheduledFuture = taskScheduler.scheduleAtFixedRate(singleTask, new Date(todayStartMills), taskModel.getInterval() * 60 * 1000);
scheduledFuture = taskScheduler.scheduleAtFixedRate(singleTask,1 * 10 * 1000);//10000毫秒,10s
}else{
scheduledFuture = taskScheduler.scheduleAtFixedRate(singleTask,taskModel.getInterval() * 60 * 1000);
//}
}
TaskStroe.addTask(taskModel.getId(),scheduledFuture);
... ...
... ... @@ -44,7 +44,7 @@ public class SingleTask implements Runnable {
}
//获取数据
if("app_collect_sample".equals(taskModel.getDatabase())&&taskModel.getInfluxSql()!=null&&taskModel.getInfluxSql().indexOf("network_30s")>0){
logger.error("begin execute app_collect_sample :" + taskModel.getInfluxSql());
logger.error("begin execute app_collect_sample {}" , taskModel);
}
List<Map> resultList= getResultWithSql(taskModel,taskModel.getInfluxSql());
Map<String, List<List<Map<String, Object>>>> result = resultList.get(0);
... ...