|
@@ -13,6 +13,7 @@ import com.utic.center.utic.traf.server.dto.LinkDto;
|
|
|
import com.utic.center.utic.traf.server.dto.LinkTrafCenterDto;
|
|
import com.utic.center.utic.traf.server.dto.LinkTrafCenterDto;
|
|
|
import com.utic.center.utic.traf.server.repository.ApplicationRepository;
|
|
import com.utic.center.utic.traf.server.repository.ApplicationRepository;
|
|
|
import com.utic.center.utic.traf.server.service.worker.WorkerUtils;
|
|
import com.utic.center.utic.traf.server.service.worker.WorkerUtils;
|
|
|
|
|
+import lombok.Getter;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
import org.apache.ibatis.session.SqlSession;
|
|
@@ -27,6 +28,7 @@ import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
|
|
+@Getter
|
|
|
@Service
|
|
@Service
|
|
|
public class LinkTrafSaveUticService implements AbstractProcessService {
|
|
public class LinkTrafSaveUticService implements AbstractProcessService {
|
|
|
|
|
|
|
@@ -35,6 +37,12 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
|
|
|
private final UticTrafficRepository uticRepo;
|
|
private final UticTrafficRepository uticRepo;
|
|
|
private final SqlSessionFactory sqlSessionFactory;
|
|
private final SqlSessionFactory sqlSessionFactory;
|
|
|
|
|
|
|
|
|
|
+ private int total;
|
|
|
|
|
+ private int link1;
|
|
|
|
|
+ private int link2;
|
|
|
|
|
+ private int link3;
|
|
|
|
|
+ private int link4;
|
|
|
|
|
+
|
|
|
public LinkTrafSaveUticService(
|
|
public LinkTrafSaveUticService(
|
|
|
TraceConfig trace,
|
|
TraceConfig trace,
|
|
|
LinkService linkService,
|
|
LinkService linkService,
|
|
@@ -68,6 +76,8 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
|
|
|
ApplicationRepository.currTrafficCenter,
|
|
ApplicationRepository.currTrafficCenter,
|
|
|
ApplicationRepository.nextTrafficCenter);
|
|
ApplicationRepository.nextTrafficCenter);
|
|
|
|
|
|
|
|
|
|
+ this.total = this.link1 = this.link2 = this.link3 = this.link4 = 0;
|
|
|
|
|
+
|
|
|
long zeroSpeedCount = this.linkService.getLinkMap().values().parallelStream()
|
|
long zeroSpeedCount = this.linkService.getLinkMap().values().parallelStream()
|
|
|
.filter(link -> link.getLinkLevel() == 1)
|
|
.filter(link -> link.getLinkLevel() == 1)
|
|
|
.filter(link -> link.getTrafFsn().getState().isState())
|
|
.filter(link -> link.getTrafFsn().getState().isState())
|
|
@@ -197,24 +207,24 @@ public class LinkTrafSaveUticService implements AbstractProcessService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
long elapsedTime = 0;
|
|
long elapsedTime = 0;
|
|
|
- int link1 = 0, link2 = 0, link3 = 0, link4 = 0;
|
|
|
|
|
|
|
+ this.total = this.link1 = this.link2 = this.link3 = this.link4 = 0;
|
|
|
|
|
|
|
|
for (DbmsBatchJobResult result : mapData.values()) {
|
|
for (DbmsBatchJobResult result : mapData.values()) {
|
|
|
elapsedTime = Math.max(elapsedTime, result.getElapsedTime());
|
|
elapsedTime = Math.max(elapsedTime, result.getElapsedTime());
|
|
|
- link1 += result.getLink1();
|
|
|
|
|
- link2 += result.getLink2();
|
|
|
|
|
- link3 += result.getLink3();
|
|
|
|
|
- link4 += result.getLink4();
|
|
|
|
|
|
|
+ this.link1 += result.getLink1();
|
|
|
|
|
+ this.link2 += result.getLink2();
|
|
|
|
|
+ this.link3 += result.getLink3();
|
|
|
|
|
+ this.link4 += result.getLink4();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int resultCount = link1 + link2 + link3 + link4;
|
|
|
|
|
- jobResult.setEffects(resultCount);
|
|
|
|
|
|
|
+ this.total = this.link1 + this.link2 + this.link3 + this.link4;
|
|
|
|
|
+ jobResult.setEffects(this.total);
|
|
|
jobResult.setElapsedTime(System.currentTimeMillis() - start);
|
|
jobResult.setElapsedTime(System.currentTimeMillis() - start);
|
|
|
|
|
|
|
|
- log.info("[INF] {}", LogUtils.elapsedLog("레벨1 " + jobTable, link1, elapsedTime));
|
|
|
|
|
- log.info("[INF] {}", LogUtils.elapsedLog("레벨2 " + jobTable, link2, elapsedTime));
|
|
|
|
|
- log.info("[INF] {}", LogUtils.elapsedLog("레벨3 " + jobTable, link3, elapsedTime));
|
|
|
|
|
- log.info("[INF] {}", LogUtils.elapsedLog("레벨4 " + jobTable, link4, elapsedTime));
|
|
|
|
|
|
|
+ log.info("[INF] {}", LogUtils.elapsedLog("레벨1 " + jobTable, this.link1, elapsedTime));
|
|
|
|
|
+ log.info("[INF] {}", LogUtils.elapsedLog("레벨2 " + jobTable, this.link2, elapsedTime));
|
|
|
|
|
+ log.info("[INF] {}", LogUtils.elapsedLog("레벨3 " + jobTable, this.link3, elapsedTime));
|
|
|
|
|
+ log.info("[INF] {}", LogUtils.elapsedLog("레벨4 " + jobTable, this.link4, elapsedTime));
|
|
|
// 모든 작업이 완료된 후 결과를 출력
|
|
// 모든 작업이 완료된 후 결과를 출력
|
|
|
ApplicationRepository.processState.setEtcCnt(jobResult.getEffects());
|
|
ApplicationRepository.processState.setEtcCnt(jobResult.getEffects());
|
|
|
log.info("[INF] {}, Total", LogUtils.elapsedLog(jobTable, jobResult.getEffects(), System.currentTimeMillis() - start));
|
|
log.info("[INF] {}, Total", LogUtils.elapsedLog(jobTable, jobResult.getEffects(), System.currentTimeMillis() - start));
|