Commit 97184527 authored by gaozhentao's avatar gaozhentao

新增认证量统计

parent 6f9d4250
...@@ -106,5 +106,13 @@ public class ReliabilityApi { ...@@ -106,5 +106,13 @@ public class ReliabilityApi {
public Map saveTopology(@RequestBody String json) { public Map saveTopology(@RequestBody String json) {
return manager.saveTopology(json); return manager.saveTopology(json);
} }
/**
* 保存数据
* @return
*/
@GetMapping("getStatistics")
public Map getStatistics() {
return manager.getStatistics();
}
} }
...@@ -7,6 +7,7 @@ import com.yingxin.prms.service.asyncTask.QueryHostStatusTask; ...@@ -7,6 +7,7 @@ import com.yingxin.prms.service.asyncTask.QueryHostStatusTask;
import com.yingxin.prms.service.dao.CassandraDaoImpl; import com.yingxin.prms.service.dao.CassandraDaoImpl;
import com.yingxin.prms.service.dao.FlowDaoImpl; import com.yingxin.prms.service.dao.FlowDaoImpl;
import com.yingxin.prms.utils.CurveFittingMethod; import com.yingxin.prms.utils.CurveFittingMethod;
import com.yingxin.prms.utils.SendHttpUtil;
import com.yingxin.prms.utils.TimeUtil; import com.yingxin.prms.utils.TimeUtil;
import com.yingxin.prms.utils.TokenUtil; import com.yingxin.prms.utils.TokenUtil;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
...@@ -243,6 +244,7 @@ public class Manager { ...@@ -243,6 +244,7 @@ public class Manager {
/* 获取前六天数据 datapoints 具体时间段 数据 */ /* 获取前六天数据 datapoints 具体时间段 数据 */
List<DataPoint> dataPoints = getAgodataPoints(servicePath,flag); List<DataPoint> dataPoints = getAgodataPoints(servicePath,flag);
/* 获取今天数据 */
List<DataPoint> currDataPoint = getdataPoints(servicePath,flag); List<DataPoint> currDataPoint = getdataPoints(servicePath,flag);
/* 获取当前需要展示的横坐标 */ /* 获取当前需要展示的横坐标 */
...@@ -267,7 +269,7 @@ public class Manager { ...@@ -267,7 +269,7 @@ public class Manager {
double [] x=new double[dataPoints.size()]; double [] x=new double[dataPoints.size()];
double [] y=new double[dataPoints.size()]; double [] y=new double[dataPoints.size()];
for (int i=0;i<dataPoints.size();i++){ for (int i=0;i<dataPoints.size();i++){
x[i]=dataPoints.get(i).getTimestamp(); x[i]= i+1;
} }
for (int i=0;i<dataPoints.size();i++){ for (int i=0;i<dataPoints.size();i++){
y[i]=Double.parseDouble(String.valueOf(dataPoints.get(i).getValue()) ); y[i]=Double.parseDouble(String.valueOf(dataPoints.get(i).getValue()) );
...@@ -490,14 +492,11 @@ public class Manager { ...@@ -490,14 +492,11 @@ public class Manager {
return result; return result;
} }
public List<FlowLine> selectTopologyLine() {
List<FlowLine> flowLines = flowDao.findLineAll(); public Map getStatistics() {
if(flowLines.size()>0){ Server_Host_Info serverHostInfo = cassandraDao.getStatisticsUri();
return null; Map<String, String> map = SendHttpUtil.doGet(serverHostInfo.getService_path());
}else { return map;
return flowLines;
}
} }
/* /*
......
...@@ -91,4 +91,9 @@ public class CassandraDaoImpl { ...@@ -91,4 +91,9 @@ public class CassandraDaoImpl {
String cql ="select * from ctid_prof.server_host_info where service_path = '"+url+"' allow filtering;;"; String cql ="select * from ctid_prof.server_host_info where service_path = '"+url+"' allow filtering;;";
return template.selectOne(cql, Server_Host_Info.class); return template.selectOne(cql, Server_Host_Info.class);
} }
public Server_Host_Info getStatisticsUri() {
String cql = "select * from server_host_info where cluster_name = '平台业务实时统计服务' allow filtering";
return template.selectOne(cql, Server_Host_Info.class);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment