Commit dc5ae692 by 房斌

增加监控日志,和 增加调减判断

parent 161fa2bd
......@@ -40,7 +40,7 @@ public class DubboCustomerDownHock extends AbstractStop {
public ExecutorDetail stop() {
ExecutorDetail detail = new ExecutorDetail();
detail.setBeginTime(DateUtil.getDateTime());
detail.setServiceName("dubboDownHock1005");
detail.setServiceName("dubboDownHock1013");
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,7 +108,9 @@ 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{
str.add("matrix-monitor dubbo check service ok " + url.getServiceKey() + StringUtil.line());
if(check!=null&&check.size()==0) {
str.add("matrix-monitor dubbo check service ok " + url.getServiceKey() + StringUtil.line());
}
}
}
......
......@@ -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("ServletConnectShoutDownHock34");
List<String> str = new ArrayList<String>();
detail.setDetail(str);
detail.setCode(0);
......
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