GeezerVison is showing github.com — Merge pull request #177 from wanglinlin8/master · fcccode/uavstack@48d77b0
File treeExpand file treeCollapse file tree Open diff view settings com.creditease.uav.agent.heartbeat/src/main/java/com/creditease/agent/feature/nodeopagent/actions com.creditease.uav.healthmanager.buildComponent/config com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature healthmanager/datastore/adaptors
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.agent.heartbeat/src/main/java/com/creditease/agent/feature/nodeopagent/actions/MOFCtrlAction.java +19-6Lines changed: 19 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -86,13 +86,26 @@ public void completed(HttpClientCallbackResult result) { | 86 | 86 |
| 87 | 87 | String res = result.getReplyDataAsString(); | 88 | 88 |
| 89 | | - log.info(this, "MOFCtrlAction Success: url=" + url + ", res=" + res); | 90 | | - | 91 | | - if (!StringHelper.isEmpty(res)) { | 92 | | - isSuccess.set(true); | | 89 | + if (result.getRetCode() >= 400) { | | 90 | + log.err(this, | | 91 | + "MOFCtrlAction FAIL: retcode=" + result.getRetCode() + ", url=" + url + ", err=" + res); | | 92 | + if (result.getRetCode() >= 500) { | | 93 | + response.append("请求" + url + "完成时的状态码为【" + result.getRetCode() + "】, 服务器遇到错误而不能完成该请求."); | | 94 | + } | | 95 | + else { | | 96 | + response.append("请求" + url + "完成时的状态码为【" + result.getRetCode() + "】, 请求客户端错误."); | | 97 | + } | | 98 | + | | 99 | + isSuccess.set(false); | | 100 | + } | | 101 | + else { | | 102 | + response.append(res); | | 103 | + log.info(this, | | 104 | + "MOFCtrlAction Success: retcode=" + result.getRetCode() + ", url=" + url + ", res=" + res); | | 105 | + if (!StringHelper.isEmpty(res)) { | | 106 | + isSuccess.set(true); | | 107 | + } | 93 | 108 | } | 94 | | - | 95 | | - response.append(res); | 96 | 109 |
| 97 | 110 | cdl.countDown(); | 98 | 111 | } | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/agent.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -169,9 +169,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4243 | 169 | 169 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 170 | 170 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 171 | 171 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 172 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 173 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 174 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 172 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 173 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 174 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 175 | 175 | feature.healthmanager.MT_Monitor.ds.retry=3 | 176 | 176 | #opentsdb batch size | 177 | 177 | feature.healthmanager.MT_Monitor.ds.batchsize=50 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_pro_logserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -133,9 +133,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4242,127.0.0.1:4242 | 133 | 133 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 134 | 134 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 135 | 135 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 136 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 137 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 138 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 136 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 137 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 138 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 139 | 139 | #opentsdb batch size | 140 | 140 | feature.healthmanager.MT_Monitor.ds.batchsize=50 | 141 | 141 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_pro_pfntfyserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -134,9 +134,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4242,127.0.0.1:4242 | 134 | 134 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 135 | 135 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 136 | 136 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 137 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 138 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 139 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 137 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 138 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 139 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 140 | 140 | #opentsdb batch size | 141 | 141 | feature.healthmanager.MT_Monitor.ds.batchsize=50 | 142 | 142 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_test_logserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -134,9 +134,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4243 | 134 | 134 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 135 | 135 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 136 | 136 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 137 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 138 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 139 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 137 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 138 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 139 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 140 | 140 | #opentsdb batch size | 141 | 141 | feature.healthmanager.MT_Monitor.ds.batchsize=50 | 142 | 142 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_test_moserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -135,9 +135,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4243 | 135 | 135 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 136 | 136 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 137 | 137 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 138 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 139 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 140 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 138 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 139 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 140 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 141 | 141 | #opentsdb batch size | 142 | 142 | feature.healthmanager.MT_Monitor.ds.batchsize=300 | 143 | 143 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_test_nodeserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -135,9 +135,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4243 | 135 | 135 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 136 | 136 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 137 | 137 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 138 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 139 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 140 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 138 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 139 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 140 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 141 | 141 | #opentsdb batch size | 142 | 142 | feature.healthmanager.MT_Monitor.ds.batchsize=300 | 143 | 143 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager.buildComponent/config/hm_test_pnhbserver.properties +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -205,9 +205,9 @@ feature.healthmanager.MT_Monitor.ds.servers=127.0.0.1:4243 | 205 | 205 | feature.healthmanager.MT_Monitor.ds.db=monitorDataStore | 206 | 206 | feature.healthmanager.MT_Monitor.ds.maxPerRoute=10 | 207 | 207 | feature.healthmanager.MT_Monitor.ds.maxRoute=50 | 208 | | -feature.healthmanager.MT_Monitor.ds.soTimeout=10000 | 209 | | -feature.healthmanager.MT_Monitor.ds.connTimeout=5000 | 210 | | -feature.healthmanager.MT_Monitor.ds.reqTimeout=3000 | | 208 | +feature.healthmanager.MT_Monitor.ds.soTimeout=30000 | | 209 | +feature.healthmanager.MT_Monitor.ds.connTimeout=30000 | | 210 | +feature.healthmanager.MT_Monitor.ds.reqTimeout=30000 | 211 | 211 | #opentsdb batch size | 212 | 212 | feature.healthmanager.MT_Monitor.ds.batchsize=50 | 213 | 213 | feature.healthmanager.MT_Monitor.ds.retry=3 | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/HealthManager.java +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -73,6 +73,7 @@ public class HealthManager extends AgentFeatureComponent { | 73 | 73 | private boolean isStartLifeKeeper = false; | 74 | 74 |
| 75 | 75 | public HealthManager(String cName, String feature) { | | 76 | + | 76 | 77 | super(cName, feature); | 77 | 78 | } | 78 | 79 |
| @@ -378,15 +379,15 @@ private void buildDataStores(IConfigurationManager icm) { | 378 | 379 | buildDataStore(icm, notifyKey, DataStoreType.MONGODB, new NotifyDataAdpater(), null); | 379 | 380 |
| 380 | 381 | Map<String, Object> nctx = new HashMap<String, Object>(); | 381 | | - mctx.put(DataStoreProtocol.OPENTSDB_CLIENT_MAXPERROUTE, DataConvertHelper | | 382 | + nctx.put(DataStoreProtocol.OPENTSDB_CLIENT_MAXPERROUTE, DataConvertHelper | 382 | 383 | .toInt(icm.getFeatureConfiguration(this.feature, nodeinfoKey + ".ds.maxPerRoute"), 10)); | 383 | | - mctx.put(DataStoreProtocol.OPENTSDB_CLIENT_MAXROUTE, | | 384 | + nctx.put(DataStoreProtocol.OPENTSDB_CLIENT_MAXROUTE, | 384 | 385 | DataConvertHelper.toInt(icm.getFeatureConfiguration(this.feature, nodeinfoKey + ".ds.maxRoute"), 50)); | 385 | | - mctx.put(DataStoreProtocol.OPENTSDB_CLIENT_SOTIMEOUT, DataConvertHelper | | 386 | + nctx.put(DataStoreProtocol.OPENTSDB_CLIENT_SOTIMEOUT, DataConvertHelper | 386 | 387 | .toInt(icm.getFeatureConfiguration(this.feature, nodeinfoKey + ".ds.soTimeout"), 5000)); | 387 | | - mctx.put(DataStoreProtocol.OPENTSDB_CLIENT_CONNTIMEOUT, DataConvertHelper | | 388 | + nctx.put(DataStoreProtocol.OPENTSDB_CLIENT_CONNTIMEOUT, DataConvertHelper | 388 | 389 | .toInt(icm.getFeatureConfiguration(this.feature, nodeinfoKey + ".ds.connTimeout"), 5000)); | 389 | | - mctx.put(DataStoreProtocol.OPENTSDB_CLIENT_REQTIMEOUT, DataConvertHelper | | 390 | + nctx.put(DataStoreProtocol.OPENTSDB_CLIENT_REQTIMEOUT, DataConvertHelper | 390 | 391 | .toInt(icm.getFeatureConfiguration(this.feature, nodeinfoKey + ".ds.reqTimeout"), 5000)); | 391 | 392 |
| 392 | 393 | // build nodeinfo ds | |
Collapse file Copy file name to clipboardExpand all lines: com.creditease.uav.healthmanager/src/main/java/com/creditease/uav/feature/healthmanager/datastore/adaptors/NotifyDataAdpater.java +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -79,6 +79,7 @@ public Object prepareInsertObj(DataStoreMsg msg, DataStoreConnection NotifyDataA | 79 | 79 | document.put("ip", ne.getIP()); | 80 | 80 | document.put("appgroup", args.get("appgroup")); | 81 | 81 | document.put("createtime", System.currentTimeMillis()); | | 82 | + document.put("notifyType", getNotifyType(ne.getTitle())); | 82 | 83 |
| 83 | 84 | documents.add(document); | 84 | 85 | } | @@ -119,4 +120,13 @@ public String getKeyfromNTFE(NotificationEvent data) { | 119 | 120 | return key; | 120 | 121 | } | 121 | 122 |
| | 123 | + public static String getNotifyType(String title) { | | 124 | + String[] titleArray = title.split("@"); | | 125 | + if (titleArray.length > 2) { | | 126 | + return titleArray[1]; | | 127 | + } | | 128 | + else { | | 129 | + return "UNKNOWN"; | | 130 | + } | | 131 | + } | 122 | 132 | } |
|