Commit 386fdfaf authored by duanruiming's avatar duanruiming

[update] 测试优化线程池运行

parent ec6798c7
...@@ -209,7 +209,7 @@ public class DTSignalStatusServiceImpl implements SignalStatusService { ...@@ -209,7 +209,7 @@ public class DTSignalStatusServiceImpl implements SignalStatusService {
phaseStageTime = phaseStageTimeChain.get(i); phaseStageTime = phaseStageTimeChain.get(i);
} }
} }
// 通过相位号获取过时间 // 通过相位号获取过时间
List<Integer> phaseList = phaseStageInfoPojo.getPhaseList(); List<Integer> phaseList = phaseStageInfoPojo.getPhaseList();
List<PhaseInfoPojo> phaseInfoPojos = SignalDataCache.phaseInfoCache.get(crossId); List<PhaseInfoPojo> phaseInfoPojos = SignalDataCache.phaseInfoCache.get(crossId);
Integer redTime = 0; Integer redTime = 0;
......
...@@ -97,7 +97,6 @@ public class SignalStatusTask { ...@@ -97,7 +97,6 @@ public class SignalStatusTask {
lightsStatusVOS = mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {}); lightsStatusVOS = mapper.convertValue(jsonViewObject.getContent(), new TypeReference<List<LightsStatusVO>>() {});
} }
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
log.info("当前路口编号:{},海康返回灯态时间:{}ms", crossId, (end - start));
RealTimeDataWebSocket webSocket = entry.getValue(); RealTimeDataWebSocket webSocket = entry.getValue();
if (!CollectionUtils.isEmpty(lightsStatusVOS)) { if (!CollectionUtils.isEmpty(lightsStatusVOS)) {
...@@ -112,13 +111,11 @@ public class SignalStatusTask { ...@@ -112,13 +111,11 @@ public class SignalStatusTask {
runModeTimeMap.put(crossIdStr, ++countTimeCahce); runModeTimeMap.put(crossIdStr, ++countTimeCahce);
} }
lightsStatusVO.setCycleCountDown(runModeTimeMap.get(crossIdStr)); lightsStatusVO.setCycleCountDown(runModeTimeMap.get(crossIdStr));
log.info("路口编号:{},控制剩余时长:{}", crossIdStr, runModeTimeMap.get(crossIdStr));
} else if (StringUtils.equals(lightsStatusVO.getRunMode(), "11")) { } else if (StringUtils.equals(lightsStatusVO.getRunMode(), "11")) {
runModeTimeMap.remove(crossIdStr); runModeTimeMap.remove(crossIdStr);
} }
Constants.controlModeMap.put(crossId, lightsStatusVO.getRunMode()); Constants.controlModeMap.put(crossId, lightsStatusVO.getRunMode());
try { try {
log.error("{}路口倒计时:{}", crossId, lightsStatusVOS.get(0).getCycleCountDown());
webSocket.sendInfo(mapper.writeValueAsString(lightsStatusVOS), crossIdStr); webSocket.sendInfo(mapper.writeValueAsString(lightsStatusVOS), crossIdStr);
} catch (Exception e) { } catch (Exception e) {
log.error("RealTimeDataWebSocket发送异常,异常信息:", e); log.error("RealTimeDataWebSocket发送异常,异常信息:", e);
...@@ -129,6 +126,8 @@ public class SignalStatusTask { ...@@ -129,6 +126,8 @@ public class SignalStatusTask {
}); });
} }
} }
commonThreadPoolExecutor.shutdown();
log.info("当前线程数量:{}", Thread.currentThread().activeCount());
} catch (Exception e) { } catch (Exception e) {
log.error("实时推送灯态数据失败", e); log.error("实时推送灯态数据失败", e);
} }
......
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