...
|
...
|
@@ -2,6 +2,7 @@ package com.monitor.middleware.nginx.task.job.oneJob; |
|
|
|
|
|
import com.monitor.common.util.SpringContextUtils;
|
|
|
import com.monitor.influxdb.InfluxDBQuery;
|
|
|
import com.monitor.influxdb.InfluxDataReporter;
|
|
|
import com.monitor.influxdb.contants.InfluxDBContants;
|
|
|
import com.monitor.middleware.nginx.common.ApiMapValueCompare;
|
|
|
import com.monitor.middleware.nginx.constant.InterVar;
|
...
|
...
|
@@ -21,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap; |
|
|
/**
|
|
|
* Created by yoho on 2016/6/28.
|
|
|
*/
|
|
|
public class BaseLogJob extends InfluxDBQuery implements Callable {
|
|
|
public class BaseLogJob implements Callable {
|
|
|
public static final Logger DEBUG = LoggerFactory.getLogger(BaseLogJob.class);
|
|
|
|
|
|
private static ConcurrentHashMap<String, Integer> KINDEXMAPS = new ConcurrentHashMap<>();
|
...
|
...
|
@@ -32,6 +33,9 @@ public class BaseLogJob extends InfluxDBQuery implements Callable { |
|
|
|
|
|
protected List<ApiSeriesModel> apiSeriesModelList = new ArrayList<>();
|
|
|
|
|
|
//
|
|
|
public InfluxDataReporter influxDataReporter;
|
|
|
|
|
|
private String type;
|
|
|
|
|
|
DecimalFormat format = new DecimalFormat("0.00");
|
...
|
...
|
@@ -40,6 +44,8 @@ public class BaseLogJob extends InfluxDBQuery implements Callable { |
|
|
|
|
|
public BaseLogJob(String measureName, String type) {
|
|
|
|
|
|
this.influxDataReporter = SpringContextUtils.getBeanByClass(InfluxDataReporter.class);
|
|
|
|
|
|
this.alarmMsgComp = SpringContextUtils.getBeanByClass(AlarmMsgComp.class);
|
|
|
|
|
|
this.measureName = measureName;
|
...
|
...
|
@@ -97,7 +103,7 @@ public class BaseLogJob extends InfluxDBQuery implements Callable { |
|
|
DEBUG.debug("Start to execute query command : {}", sql);
|
|
|
|
|
|
try {
|
|
|
QueryResult result = query(InfluxDBContants.AWS, sql, InterVar.DBNAME);
|
|
|
QueryResult result = influxDataReporter.queryResult(InfluxDBContants.AWS, sql, InterVar.DBNAME);
|
|
|
|
|
|
if (null == result || 0 == result.getResults().size()) {
|
|
|
DEBUG.error("Failed to execute query commnad: {} ", sql);
|
...
|
...
|
|