...
|
...
|
@@ -5,10 +5,12 @@ import com.monitor.middleware.nginx.constant.InterVar; |
|
|
import com.monitor.middleware.nginx.model.ApiSeriesModel;
|
|
|
import com.monitor.middleware.nginx.model.ApiStaModel;
|
|
|
import com.monitor.middleware.rabbitmq.component.InfluxComp;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.aspectj.lang.annotation.After;
|
|
|
import org.influxdb.dto.BatchPoints;
|
|
|
import org.influxdb.dto.Point;
|
|
|
import org.influxdb.dto.QueryResult;
|
|
|
import org.jboss.netty.util.internal.StringUtil;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
...
|
...
|
@@ -30,15 +32,19 @@ public class BaseLogJob implements Callable { |
|
|
|
|
|
protected List<ApiSeriesModel> apiSeriesModelList = new ArrayList<>();
|
|
|
|
|
|
private String type;
|
|
|
|
|
|
DecimalFormat format = new DecimalFormat("0.00");
|
|
|
|
|
|
protected String measureName;
|
|
|
|
|
|
public BaseLogJob(InfluxComp influxComp, String measureName) {
|
|
|
public BaseLogJob(InfluxComp influxComp, String measureName, String type) {
|
|
|
|
|
|
this.influxComp = influxComp;
|
|
|
|
|
|
this.measureName = measureName;
|
|
|
|
|
|
this.type = type;
|
|
|
}
|
|
|
|
|
|
public void doTask() {
|
...
|
...
|
@@ -208,6 +214,9 @@ public class BaseLogJob implements Callable { |
|
|
|
|
|
for (List<Object> oneRow : oneSeries.getValues()) {
|
|
|
|
|
|
if (!StringUtils.equals(type, queryLocation(oneRow.get(KINDEXMAPS.get("log_ip")).toString()))) {
|
|
|
continue;
|
|
|
}
|
|
|
ApiSeriesModel apiSeriesModel = new ApiSeriesModel();
|
|
|
|
|
|
apiSeriesModel.setLogIp(oneRow.get(KINDEXMAPS.get("log_ip")).toString());
|
...
|
...
|
@@ -219,6 +228,7 @@ public class BaseLogJob implements Callable { |
|
|
apiSeriesModel.setStatus(oneRow.get(KINDEXMAPS.get("request_status")).toString());
|
|
|
|
|
|
apiSeriesModelList.add(apiSeriesModel);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -326,6 +336,15 @@ public class BaseLogJob implements Callable { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private String queryLocation(String ip) {
|
|
|
if (ip.startsWith(InterVar.AWS_PREFIX)) {
|
|
|
return InterVar.AWS_TYPE;
|
|
|
} else {
|
|
|
return InterVar.QC_TYPE;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Object call() throws Exception {
|
|
|
doTask();
|
...
|
...
|
|