Authored by qinchao

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

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