Authored by linlong

Merge branch 'dev_memcache' of git.yoho.cn:ops/monitor-service into dev_memcache

# By jack.xue
# Via jack.xue
* 'dev_memcache' of git.yoho.cn:ops/monitor-service:
  增加异常捕获范围
  增加logger
  延迟
  rabbit 数据暂不写入influxdb
... ... @@ -57,7 +57,7 @@ public interface InterVar {
String DBTAG = "moId";
int MONIT_TIMEOUT = 30;
int MONIT_TIMEOUT = 60;
String RETENTION_POLICY = "default";
... ...
... ... @@ -34,6 +34,8 @@ public class ClusterViewJob implements Callable {
}
public void doTask() {
DEBUG.info("Start to execute cluster view job in moid {}", this.moId);
MObjectInfo moInfo = InterVar.moMaps.get(moId);
String url = MessageFormat.format(InterVar.URLFORMAT, moInfo.getMoHostIp(), InterVar.port) + InterVar.NODES_URL;
... ... @@ -67,10 +69,12 @@ public class ClusterViewJob implements Callable {
if (null != oneView) {
influxComp.doWriteView(oneView,InterVar.DBNAME);
/* influxComp.doWriteView(oneView,InterVar.DBNAME);*/
InterVar.clusterViewMaps.put(moId, oneView);
}
DEBUG.info("End to execute cluster view job in moid {}", this.moId);
}
@Override
... ...
... ... @@ -41,6 +41,9 @@ public class OverViewJob implements Callable {
}
public void doTask() {
DEBUG.info("Start to execute over view job in moid {}", this.moId);
MObjectInfo moInfo = InterVar.moMaps.get(moId);
String url = MessageFormat.format(InterVar.URLFORMAT, moInfo.getMoHostIp(), InterVar.port) + InterVar.OVERVIEW_URL;
... ... @@ -96,10 +99,12 @@ public class OverViewJob implements Callable {
if (null != oneView) {
influxComp.doWriteView(oneView,InterVar.DBNAME);
/*influxComp.doWriteView(oneView,InterVar.DBNAME);*/
InterVar.overViewMaps.put(moId, overViewModel);
}
DEBUG.info("End to execute over view job in moid {}", this.moId);
}
@Override
... ...
... ... @@ -58,6 +58,8 @@ public class QueueViewJob implements Callable {
}
public void doTask() {
DEBUG.info("Start to execute queue view job in moid {}", this.moId);
MObjectInfo moInfo = InterVar.moMaps.get(moId);
String url = MessageFormat.format(InterVar.URLFORMAT, moInfo.getMoHostIp(), InterVar.port) + InterVar.QUEUE_URL;
... ... @@ -102,10 +104,12 @@ public class QueueViewJob implements Callable {
if (null != oneView) {
influxComp.doWriteView(oneView, InterVar.DBNAME);
/*influxComp.doWriteView(oneView, InterVar.DBNAME);*/
InterVar.queueViewMaps.put(moId, oneView);
}
DEBUG.info("End to execute queue view job in moid {}", this.moId);
}
... ... @@ -153,9 +157,8 @@ public class QueueViewJob implements Callable {
}
//初始化
private void initQueueAlert(String moId, QueueInfo queueInfo)
{
RabbitAlertInfo alertInfo=new RabbitAlertInfo();
private void initQueueAlert(String moId, QueueInfo queueInfo) {
RabbitAlertInfo alertInfo = new RabbitAlertInfo();
alertInfo.setAlertHigh(200);
... ...
... ... @@ -62,10 +62,12 @@ public class TwemproxyTask extends Task {
twemproxyInfo = new TwemproxyInfo(this.getIp(), this.getPort(), info);
} catch (IOException e) {
} catch (Exception e) {
this.getAlarmMsgService().sendSms("Twemproxy", "Failed to query Twemproxy " + this.getUrl() + " monitor info.", this.getSnsMobileConfig().getBaseMobile());
DEBUG.error("Failed to query twemproxy {} monitor info...error {} ", this.getUrl(), e);
return;
}
... ... @@ -138,7 +140,7 @@ public class TwemproxyTask extends Task {
for (Map.Entry<String, Long> entry : twemproxyInfo.getRequestMap().entrySet()) {
taskService.submit(new RedisTask(entry.getKey(), entry.getValue(),this.getUrl(), this.getAlarmMsgService(), this.getSnsMobileConfig()));
taskService.submit(new RedisTask(entry.getKey(), entry.getValue(), this.getUrl(), this.getAlarmMsgService(), this.getSnsMobileConfig()));
}
taskService.shutdown();
... ...