Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PRMS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengfunan
PRMS
Commits
97184527
Commit
97184527
authored
Jan 18, 2021
by
gaozhentao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增认证量统计
parent
6f9d4250
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
ReliabilityApi.java
src/main/java/com/yingxin/prms/api/ReliabilityApi.java
+8
-0
Manager.java
src/main/java/com/yingxin/prms/service/business/Manager.java
+7
-8
CassandraDaoImpl.java
...n/java/com/yingxin/prms/service/dao/CassandraDaoImpl.java
+5
-0
No files found.
src/main/java/com/yingxin/prms/api/ReliabilityApi.java
View file @
97184527
...
@@ -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
();
}
}
}
src/main/java/com/yingxin/prms/service/business/Manager.java
View file @
97184527
...
@@ -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
;
}
}
}
/*
/*
...
...
src/main/java/com/yingxin/prms/service/dao/CassandraDaoImpl.java
View file @
97184527
...
@@ -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
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment