Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
dc5ae692
Commit
dc5ae692
authored
Jan 26, 2021
by
房斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加监控日志,和 增加调减判断
parent
161fa2bd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
DubboCustomerDownHock.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/DubboCustomerDownHock.java
+8
-3
ServletConnectShoutDownHock.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/ServletConnectShoutDownHock.java
+1
-1
No files found.
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/DubboCustomerDownHock.java
View file @
dc5ae692
...
...
@@ -40,7 +40,7 @@ public class DubboCustomerDownHock extends AbstractStop {
public
ExecutorDetail
stop
()
{
ExecutorDetail
detail
=
new
ExecutorDetail
();
detail
.
setBeginTime
(
DateUtil
.
getDateTime
());
detail
.
setServiceName
(
"dubboDownHock10
05
"
);
detail
.
setServiceName
(
"dubboDownHock10
13
"
);
List
<
String
>
str
=
new
ArrayList
<
String
>();
detail
.
setDetail
(
str
);
detail
.
setCode
(
0
);
...
...
@@ -57,16 +57,17 @@ public class DubboCustomerDownHock extends AbstractStop {
while
(
iterator
.
hasNext
())
{
Registry
r
=
iterator
.
next
();
zookperRegster
=
(
ZookeeperRegistry
)
r
;
logger
.
info
(
"RegistryServerSync r-------------->"
+
zookperRegster
.
getRegistered
().
toString
());
str
.
add
(
" DubboCustomerDownHock zookperRegstered-------------->"
+
zookperRegster
.
getRegistered
().
toString
()+
StringUtil
.
line
());
if
(
zookperRegster
.
getRegistered
()
!=
null
&&
zookperRegster
.
getRegistered
().
size
()
>
0
)
{
urls
=
zookperRegster
.
getRegistered
();
logger
.
info
(
"RegistryServerSync urls-------------->"
+((
urls
!=
null
&&
urls
.
size
()>
0
)?
JSON
.
toJSONString
(
urls
):
"url si null"
));
str
.
add
(
" DubboCustomerDownHock zookperRegstered urls-------------->"
+((
urls
!=
null
&&
urls
.
size
()>
0
)?
JSON
.
toJSONString
(
urls
):
"url si null"
)+
StringUtil
.
line
(
));
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
checks
=
new
ArrayList
<
URL
>();
for
(
URL
value
:
urls
)
{
checks
.
add
(
value
);
try
{
str
.
add
(
"provider url executer unregister before:"
+
value
.
getServiceInterface
()
+
" time:"
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
).
format
(
new
Date
())
+
StringUtil
.
line
());
// throw new IllegalStateException("failed to tet");
zookperRegster
.
unregister
((
URL
)
value
);
LoggerUtil
.
info
(
"provider url unregister success :"
+
value
.
getServiceInterface
()
+
" time:"
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
).
format
(
new
Date
())
+
StringUtil
.
line
());
str
.
add
(
"delete provider url success:"
+
value
.
getServiceInterface
()
+
" time:"
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss:SSS"
).
format
(
new
Date
())
+
StringUtil
.
line
());
...
...
@@ -95,7 +96,9 @@ public class DubboCustomerDownHock extends AbstractStop {
for
(
URL
url
:
checks
)
{
if
(
StringUtil
.
isNotEmpty
(
url
.
getAddress
())
&&
StringUtil
.
isNotEmpty
(
name
))
{
List
<
String
>
check
=
null
;
try
{
// throw new IllegalStateException("failed to tet");
check
=
providerService
.
findServicesByAddressAndName
(
url
.
getAddress
(),
name
);
}
catch
(
Exception
e
)
{
detail
.
setCode
(-
1
);
...
...
@@ -105,8 +108,10 @@ public class DubboCustomerDownHock extends AbstractStop {
str
.
add
(
"warn:matrix-monitor check service failure "
+
url
.
getServiceKey
()
+
" reason zk notice failed "
+
StringUtil
.
line
());
detail
.
setCode
(-
1
);
}
else
{
if
(
check
!=
null
&&
check
.
size
()==
0
)
{
str
.
add
(
"matrix-monitor dubbo check service ok "
+
url
.
getServiceKey
()
+
StringUtil
.
line
());
}
}
}
}
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/ServletConnectShoutDownHock.java
View file @
dc5ae692
...
...
@@ -30,7 +30,7 @@ public class ServletConnectShoutDownHock extends AbstractStop {
public
ExecutorDetail
stop
()
{
ExecutorDetail
detail
=
new
ExecutorDetail
();
detail
.
setBeginTime
(
DateUtil
.
getDateTime
());
detail
.
setServiceName
(
"ServletConnectShoutDownHock"
);
detail
.
setServiceName
(
"ServletConnectShoutDownHock
34
"
);
List
<
String
>
str
=
new
ArrayList
<
String
>();
detail
.
setDetail
(
str
);
detail
.
setCode
(
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