...
|
...
|
@@ -2,6 +2,7 @@ package com.monitor.javaserver.service.impl; |
|
|
|
|
|
import com.model.MObjectInfo;
|
|
|
import com.model.TypeInfo;
|
|
|
import com.monitor.influxdb.contants.InfluxDBContants;
|
|
|
import com.monitor.influxdb.mapper.ServiceAccessMapper;
|
|
|
import com.monitor.influxdb.mapper.ServiceServerExceptionMapper;
|
|
|
import com.monitor.influxdb.mapper.VMInfoMapper;
|
...
|
...
|
@@ -73,6 +74,10 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
resp.setErrorCount(errorInfoMap.get(ip) == null ? 0 : errorInfoMap.get(ip).size());
|
|
|
resp.setErrorInfo(errorInfoMap.get(ip));
|
|
|
resp.setTimeoutInfo(timeoutInfoMap.get(ip));
|
|
|
if(req.getServiceType() == -1){
|
|
|
resp.setServiceNames(mObjectInfo.getMoName());
|
|
|
}
|
|
|
|
|
|
|
|
|
List vmList = (List)vmInfoMap.get(ip);
|
|
|
if(vmList != null){
|
...
|
...
|
@@ -89,7 +94,7 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
|
|
|
|
|
|
@Override
|
|
|
public Map getJavaApiGraph(NewJavaApiInfoReq req){
|
|
|
public Map getJavaApiGraphByServiceType(NewJavaApiInfoReq req){
|
|
|
Map returnMap = new HashMap();
|
|
|
|
|
|
List<MObjectInfo> objectInfoList = getMObjectInfoList(req);
|
...
|
...
|
@@ -98,9 +103,9 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
}
|
|
|
Map<String,List> map = null;
|
|
|
if(req.getGraphType()==2){
|
|
|
map = serviceServerExceptionMapper.getGraphInfo(req.getServiceName());
|
|
|
map = serviceServerExceptionMapper.getJavaApiGraphByServiceType(req.getServiceName());
|
|
|
}else{
|
|
|
map = serviceAccessMapper.getGraphInfo(req.getServiceName());
|
|
|
map = serviceAccessMapper.getJavaApiGraphByServiceType(req.getServiceName());
|
|
|
}
|
|
|
|
|
|
List<String> timeList = new ArrayList<String>();
|
...
|
...
|
@@ -135,6 +140,53 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public Map getServiceNameJavaApiGraph(NewJavaApiInfoReq req){
|
|
|
Map returnMap = new HashMap();
|
|
|
List<TypeInfo> typeInfoList = mTypeInfoMapper.getChildTypesInfoByAlias("java_app");
|
|
|
if(CollectionUtils.isEmpty(typeInfoList)){
|
|
|
return null;
|
|
|
}
|
|
|
String source = "";
|
|
|
if(req.getCloudType() == 2){
|
|
|
source = InfluxDBContants.Q_CLOUD;
|
|
|
}else{
|
|
|
source = InfluxDBContants.AWS;
|
|
|
}
|
|
|
|
|
|
Map<String,List> map = null;
|
|
|
if(req.getGraphType()==2){
|
|
|
map = serviceServerExceptionMapper.getServiceNameJavaApiGraph(source);
|
|
|
}else{
|
|
|
map = serviceAccessMapper.getServiceNameJavaApiGraph(source);
|
|
|
}
|
|
|
|
|
|
List<String> timeList = new ArrayList<String>();
|
|
|
List contentList = new ArrayList<>();
|
|
|
for(TypeInfo typeInfo :typeInfoList){
|
|
|
Map dataMap = new HashMap();
|
|
|
String typeName = typeInfo.getTypeName();
|
|
|
List list = map.get(typeName);
|
|
|
if(list != null && list.size() > 0){
|
|
|
if(timeList.size()==0){
|
|
|
timeList = (List)list.get(0);
|
|
|
}
|
|
|
dataMap.put("data",list.get(1));
|
|
|
}else{
|
|
|
dataMap.put("data",new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
dataMap.put("name",typeName);
|
|
|
contentList.add(dataMap);
|
|
|
}
|
|
|
|
|
|
|
|
|
returnMap.put("time",timeList);
|
|
|
returnMap.put("content",contentList);
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public List<String> getIPList(NewJavaApiInfoReq req){
|
...
|
...
|
@@ -177,16 +229,7 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
private List<MObjectInfo> getMObjectInfoList(NewJavaApiInfoReq req){
|
|
|
//servicetype=-1表示查询全部 0表示gateway
|
|
|
if(req.getServiceType() == -1){
|
|
|
List<TypeInfo> typeInfoList = mTypeInfoMapper.getChildTypesInfoByAlias("java_app");
|
|
|
if(CollectionUtils.isEmpty(typeInfoList)){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
List<Integer> typeList = new ArrayList<>();
|
|
|
for(TypeInfo typeInfo : typeInfoList){
|
|
|
typeList.add(typeInfo.getTypeId());
|
|
|
}
|
|
|
List<MObjectInfo> objectInfoList = mObjectInfoMapper.selectMObjectsInfoByTypes(typeList);
|
|
|
List<MObjectInfo> objectInfoList = mObjectInfoMapper.selectJavaDistinctHostIP();
|
|
|
return objectInfoList;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -201,15 +244,6 @@ public class NewJavaApiInfoServiceImpl implements NewJavaApiInfoService { |
|
|
List<MObjectInfo> objectInfoList = mObjectInfoMapper.getTypeMosInfo(req.getServiceType());
|
|
|
return objectInfoList;
|
|
|
|
|
|
// if(req.getServiceType() == 0){
|
|
|
// TypeInfo typeInfo = mTypeInfoMapper.selectTypeInfoByName(req.getServiceName());
|
|
|
// if(typeInfo == null){
|
|
|
// return null;
|
|
|
// }
|
|
|
// req.setServiceType(typeInfo.getTypeId());
|
|
|
// }
|
|
|
// List<MObjectInfo> objectInfoList = mObjectInfoMapper.getTypeMosInfo(req.getServiceType());
|
|
|
// return objectInfoList;
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
|