Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
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
liyuan
byit-myth-job
Commits
9b589b96
Commit
9b589b96
authored
Apr 08, 2020
by
guo_minglei@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计获取方式
parent
0b8ad423
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
23 deletions
+41
-23
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+7
-6
NodeMapper.java
...-admin-core/src/main/java/com/byit/mapper/NodeMapper.java
+3
-0
StatusSnapshootThreadRunHelper.java
...om/byit/thread/helper/StatusSnapshootThreadRunHelper.java
+18
-16
NodeMapper.xml
.../myth-admin-core/src/main/resources/mapper/NodeMapper.xml
+13
-1
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
9b589b96
...
@@ -749,14 +749,15 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -749,14 +749,15 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//如果工作空间下面有数据
//如果工作空间下面有数据
if
(
flowIdList
.
size
()
>
0
){
if
(
flowIdList
.
size
()
>
0
){
StatisticData
flowStatisticData
=
runRecordingMapper
.
findStatusByStartAndEndTime
(
new
Date
(
startTime
),
new
Date
(
endTime
),
flowIdList
);
StatisticData
flowStatisticData
=
runRecordingMapper
.
findStatusByStartAndEndTime
(
new
Date
(
startTime
),
new
Date
(
endTime
),
flowIdList
);
StatisticData
unstartflowStatisticData
=
waitingRecordMapper
.
findStatusByStartAndEndTime
(
flowIdList
);
if
(
null
!=
flowStatisticData
){
if
(
null
!=
unstartflowStatisticData
){
flowStatisticData
=
new
StatisticData
();
flowStatisticData
.
setUnstart
(
flow
StatisticData
.
getUnstart
()
+
unstartflowStatisticData
.
getUnstart
());
flowStatisticData
.
setUnstart
(
flow
List
.
size
());
}
}
StatisticData
nodeStatisticData
=
jobTaskRunLogMapper
.
findStatusByStartAndEndTime
(
new
Date
(
startTime
),
new
Date
(
endTime
),
flowIdList
);
StatisticData
nodeStatisticData
=
jobTaskRunLogMapper
.
findStatusByStartAndEndTime
(
new
Date
(
startTime
),
new
Date
(
endTime
),
flowIdList
);
StatisticData
unstartNodeStatisticData
=
waitingTaskMapper
.
findStatusByStartAndEndTime
(
flowIdList
);
if
(
null
!=
nodeStatisticData
){
if
(
null
!=
unstartNodeStatisticData
){
nodeStatisticData
=
new
StatisticData
();
nodeStatisticData
.
setUnstart
(
nodeStatisticData
.
getUnstart
()
+
unstartNodeStatisticData
.
getUnstart
());
List
<
Node
>
nodeList
=
nodeMapper
.
findbyFlowIds
(
flowIdList
);
nodeStatisticData
.
setUnstart
(
nodeList
.
size
());
}
}
List
<
FlowStatusSnapshoot
>
flowStatusSnapshootList
=
flowStatusSnapshootMapper
.
findByTime
(
startTime
,
endTime
);
List
<
FlowStatusSnapshoot
>
flowStatusSnapshootList
=
flowStatusSnapshootMapper
.
findByTime
(
startTime
,
endTime
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/mapper/NodeMapper.java
View file @
9b589b96
...
@@ -93,4 +93,6 @@ public interface NodeMapper {
...
@@ -93,4 +93,6 @@ public interface NodeMapper {
* @return
* @return
*/
*/
List
<
Node
>
findByFlowIdAndName
(
@Param
(
"flowId"
)
Integer
flowId
,
@Param
(
"nodeNameList"
)
List
<
String
>
nodeNameList
);
List
<
Node
>
findByFlowIdAndName
(
@Param
(
"flowId"
)
Integer
flowId
,
@Param
(
"nodeNameList"
)
List
<
String
>
nodeNameList
);
List
<
Node
>
findbyFlowIds
(
@Param
(
"flowIdList"
)
List
<
Integer
>
flowIdList
);
}
}
\ No newline at end of file
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/helper/StatusSnapshootThreadRunHelper.java
View file @
9b589b96
...
@@ -95,28 +95,30 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
...
@@ -95,28 +95,30 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
case
"5"
:
flowStatusSnapshoot
.
setFlowStatus
(
6
);
break
;
case
"5"
:
flowStatusSnapshoot
.
setFlowStatus
(
6
);
break
;
default
:
flowStatusSnapshoot
.
setFlowStatus
(
5
);
break
;
default
:
flowStatusSnapshoot
.
setFlowStatus
(
5
);
break
;
}
}
//获取运行实例下各类状态的节点数目
StatisticData
nodeStatistic
=
jobTaskRunLogMapper
.
findStatisticDataByRunIdAndFlowId
(
runRecording
.
getRunId
(),
flow
.
getFlowId
());
//判断是否存在节点的运行日志
//存在节点运行日志
if
(
nodeStatistic
!=
null
){
int
sum
=
nodeStatistic
.
getFail
()
+
nodeStatistic
.
getSuccess
()
+
nodeStatistic
.
getRunIng
()
+
nodeStatistic
.
getKill
();
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
()
-
sum
);
flowStatusSnapshoot
.
setRuningNode
(
nodeStatistic
.
getRunIng
());
flowStatusSnapshoot
.
setSuccessNode
(
nodeStatistic
.
getSuccess
());
flowStatusSnapshoot
.
setFailNode
(
nodeStatistic
.
getFail
());
flowStatusSnapshoot
.
setKillNode
(
nodeStatistic
.
getKill
());
}
else
{
//不存在节点的运行日志
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
}
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
}
//获取运行实例下各类状态的节点数目
StatisticData
nodeStatistic
=
jobTaskRunLogMapper
.
findStatisticDataByRunIdAndFlowId
(
runRecording
.
getRunId
(),
flow
.
getFlowId
());
//判断是否存在节点的运行日志
//存在节点运行日志
if
(
nodeStatistic
!=
null
){
int
sum
=
nodeStatistic
.
getFail
()
+
nodeStatistic
.
getSuccess
()
+
nodeStatistic
.
getRunIng
()
+
nodeStatistic
.
getKill
();
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
()
-
sum
);
flowStatusSnapshoot
.
setRuningNode
(
nodeStatistic
.
getRunIng
());
flowStatusSnapshoot
.
setSuccessNode
(
nodeStatistic
.
getSuccess
());
flowStatusSnapshoot
.
setFailNode
(
nodeStatistic
.
getFail
());
flowStatusSnapshoot
.
setKillNode
(
nodeStatistic
.
getKill
());
}
else
{
//不存在节点的运行日志
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
}
}
}
}
else
{
}
else
{
//如果不存在运行实例
//如果不存在运行实例
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshoot
.
setUnstartNode
(
flow
.
getFlowNodeCount
());
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
}
}
flowStatusSnapshootList
.
add
(
flowStatusSnapshoot
);
/*
/*
排队的运行实例已经放在run_recording表中,无需二次记录
排队的运行实例已经放在run_recording表中,无需二次记录
//获取排队的运行实例
//获取排队的运行实例
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/NodeMapper.xml
View file @
9b589b96
...
@@ -136,8 +136,20 @@
...
@@ -136,8 +136,20 @@
</foreach>
</foreach>
)
)
</select>
</select>
<select
id=
"findbyFlowIds"
resultType=
"com.byit.model.Node"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from node
where flow_id in (
<foreach
collection=
"flowIdList"
item=
"flowId"
separator=
","
>
#{flowId}
</foreach>
)
</select>
<delete
id=
"deleteVirtualNode"
>
<delete
id=
"deleteVirtualNode"
>
delete from node
delete from node
where flow_id = #{flowId,jdbcType=INTEGER}
where flow_id = #{flowId,jdbcType=INTEGER}
and is_virtual = '0';
and is_virtual = '0';
...
...
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