Authored by jack.xue

catch exception

... ... @@ -27,18 +27,18 @@ public class NginxCalTask {
@Autowired
public AlarmMsgComp alarmMsgComp;
@Scheduled(fixedRate = 2*60*1000L)
@Scheduled(fixedRate = 2 * 60 * 1000L)
public void call() {
try {
InterVar.NGINX_VIEW_CONCURRENT_HASH_MAP.clear();
InterVar.EXECUTOR_SERVICE.submit(new BaseJob(alarmMsgComp,awsInfluxComp, InterVar.AWS_TYPE));
InterVar.EXECUTOR_SERVICE.submit(new BaseJob(alarmMsgComp, awsInfluxComp, InterVar.AWS_TYPE));
InterVar.EXECUTOR_SERVICE.submit(new BaseJob(alarmMsgComp,qcInfluxComp, InterVar.QC_TYPE));
}
catch (Exception e)
{
InterVar.EXECUTOR_SERVICE.submit(new BaseJob(alarmMsgComp, qcInfluxComp, InterVar.QC_TYPE));
} catch (Exception e) {
e.printStackTrace();
}
... ...
... ... @@ -88,10 +88,15 @@ public class BaseLogJob implements Callable {
DEBUG.debug("Start to execute query command : {}", sql);
QueryResult result = influxComp.doQuery(sql, InterVar.DBNAME);
try {
QueryResult result = influxComp.doQuery(sql, InterVar.DBNAME);
//parse result to api series model
buildApiModel(apiSeriesModelList, result.getResults().get(0).getSeries());
} catch (Exception e) {
DEBUG.error("Failed to execute query commnad: {} , error: {}", sql, e);
}
//parse result to api series model
buildApiModel(apiSeriesModelList, result.getResults().get(0).getSeries());
DEBUG.info("Success to query {} items from {}", apiSeriesModelList.size(), measureName);
}
... ...
package com.monitor.middleware.nginx.task.job.oneJob;
import com.monitor.common.config.SnsMobileConfig;
import com.monitor.common.service.AlarmMsgService;
import com.monitor.middleware.nginx.constant.InterVar;
import com.monitor.middleware.nginx.model.ApiSeriesModel;
import com.monitor.middleware.nginx.model.ApiStaModel;
... ... @@ -10,8 +8,6 @@ import com.monitor.middleware.rabbitmq.component.AlarmMsgComp;
import com.monitor.middleware.rabbitmq.component.InfluxComp;
import org.apache.commons.lang.StringUtils;
import java.util.Map;
/**
* Created by yoho on 2016/6/28.
... ...