Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flink-monitor
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
赵建伟
flink-monitor
Commits
b6ecda11
Commit
b6ecda11
authored
Mar 19, 2020
by
赵建伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update codes
parent
54065e39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
PortraitMonitorShdOperator.java
...mei/data/monitor/operator/PortraitMonitorShdOperator.java
+5
-3
PortraitMonitorSucOperator.java
...mei/data/monitor/operator/PortraitMonitorSucOperator.java
+6
-4
No files found.
src/main/java/com/gmei/data/monitor/operator/PortraitMonitorShdOperator.java
View file @
b6ecda11
...
...
@@ -172,9 +172,11 @@ public class PortraitMonitorShdOperator implements BaseOperator{
++
count
;
}
}
String
currentTimeStr
=
DateUtils
.
getCurrentTimeStr
(
date
);
TblMonitorPortraitShd
tblMonitorPortraitShd
=
new
TblMonitorPortraitShd
(
key
.
getField
(
0
),
count
,
currentTimeStr
);
out
.
collect
(
tblMonitorPortraitShd
);
if
(
count
>
0
){
String
currentTimeStr
=
DateUtils
.
getCurrentTimeStr
(
date
);
TblMonitorPortraitShd
tblMonitorPortraitShd
=
new
TblMonitorPortraitShd
(
key
.
getField
(
0
),
count
,
currentTimeStr
);
out
.
collect
(
tblMonitorPortraitShd
);
}
}
});
process
.
print
();
...
...
src/main/java/com/gmei/data/monitor/operator/PortraitMonitorSucOperator.java
View file @
b6ecda11
...
...
@@ -83,14 +83,16 @@ public class PortraitMonitorSucOperator implements BaseOperator{
long
currentTimestamp
=
DateUtils
.
getCurrentTimestamp
(
date
);
long
tenMinitesAgoTimestamp
=
DateUtils
.
getTenMinitesAgoTimestamp
(
date
);
for
(
GmPortraitResult
element
:
elements
)
{
long
logTime
=
Long
.
valueOf
(
element
.
getLog_time
(
));
long
logTime
=
Long
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
element
.
getLog_time
())
));
if
(
logTime
>=
tenMinitesAgoTimestamp
&&
logTime
<=
currentTimestamp
){
++
count
;
}
}
String
currentTimeStr
=
DateUtils
.
getCurrentTimeStr
(
date
);
TblMonitorPortraitSuc
tblMonitorPortraitSuc
=
new
TblMonitorPortraitSuc
(
key
.
getField
(
0
),
count
,
currentTimeStr
);
out
.
collect
(
tblMonitorPortraitSuc
);
if
(
count
>
0
){
String
currentTimeStr
=
DateUtils
.
getCurrentTimeStr
(
date
);
TblMonitorPortraitSuc
tblMonitorPortraitSuc
=
new
TblMonitorPortraitSuc
(
key
.
getField
(
0
),
count
,
currentTimeStr
);
out
.
collect
(
tblMonitorPortraitSuc
);
}
}
})
.
addSink
(
new
PortraitSucMysqlSink
(
outJdbcUrl
,
maxRetry
,
retryInteral
))
...
...
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