|
@@ -9,6 +9,7 @@ import com.tsi.comm.server.repository.TsiAlarmManager;
|
|
|
import com.tsi.comm.server.repository.TsiReportManager;
|
|
import com.tsi.comm.server.repository.TsiReportManager;
|
|
|
import com.tsi.comm.server.repository.TsiTpmsManager;
|
|
import com.tsi.comm.server.repository.TsiTpmsManager;
|
|
|
import com.tsi.comm.server.vo.TsiAlarmConfigVo;
|
|
import com.tsi.comm.server.vo.TsiAlarmConfigVo;
|
|
|
|
|
+import com.tsi.comm.server.xnet.NetUtils;
|
|
|
import com.tsi.common.utils.Elapsed;
|
|
import com.tsi.common.utils.Elapsed;
|
|
|
import com.tsi.common.utils.TimeUtils;
|
|
import com.tsi.common.utils.TimeUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -18,6 +19,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
|
|
+
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
@EnableScheduling
|
|
@EnableScheduling
|
|
@@ -33,17 +36,24 @@ public class ApplicationScheduler {
|
|
|
private final KafkaProducerService kafkaProducerService;
|
|
private final KafkaProducerService kafkaProducerService;
|
|
|
private final KafkaConsumerService kafkaConsumerService;
|
|
private final KafkaConsumerService kafkaConsumerService;
|
|
|
|
|
|
|
|
- @Scheduled(cron = "* * * * * *") // 1초 주기 작업 실행
|
|
|
|
|
|
|
+ private String hostName;
|
|
|
|
|
+
|
|
|
|
|
+ @PostConstruct
|
|
|
|
|
+ void init() {
|
|
|
|
|
+ this.hostName = NetUtils.getHostName();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Scheduled(cron = "0/5 * * * * *") //
|
|
|
public void staticsForPacketSecond() {
|
|
public void staticsForPacketSecond() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- Elapsed elapsed = new Elapsed();
|
|
|
|
|
- this.tpmsManager.resetSecond(this.config.getServerId());
|
|
|
|
|
- log.info("{}", String.format("%25s: %s", "staticsForPacketSecond", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
|
|
|
|
+// Elapsed elapsed = new Elapsed();
|
|
|
|
|
+ this.tpmsManager.resetSecond(this.config.getServerId(), this.hostName);
|
|
|
|
|
+// log.info("{}", String.format("%25s: %s", "staticsForPacketSecond", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0/5 * * * * *") // 5초 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "0/5 * * * * *") //
|
|
|
public void checkKafkaServerAlive() {
|
|
public void checkKafkaServerAlive() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|
|
@@ -56,7 +66,7 @@ public class ApplicationScheduler {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0/5 * * * * *") // 5초 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "0/5 * * * * *") //
|
|
|
public void checkSessionTimeout() {
|
|
public void checkSessionTimeout() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|
|
@@ -75,7 +85,7 @@ public class ApplicationScheduler {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.reportManager.checkSessionTimeout(timeout);
|
|
this.reportManager.checkSessionTimeout(timeout);
|
|
|
- log.info("{}", String.format("%25s: %s", "checkSessionTimeout", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
|
|
|
|
+// log.info("{}", String.format("%25s: %s", "checkSessionTimeout", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Scheduled(cron = "0/30 * * * * *") // 30초 주기 작업 실행
|
|
@Scheduled(cron = "0/30 * * * * *") // 30초 주기 작업 실행
|
|
@@ -89,10 +99,10 @@ public class ApplicationScheduler {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
Elapsed elapsed = new Elapsed();
|
|
|
this.reportManager.reportNodeSessions();
|
|
this.reportManager.reportNodeSessions();
|
|
|
// TsiSessionManager.getInstance().reportChannelSessions();
|
|
// TsiSessionManager.getInstance().reportChannelSessions();
|
|
|
- log.info("{}", String.format("%25s: %s", "reportNodeSessionAlive", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
|
|
|
|
+// log.info("{}", String.format("%25s: %s", "reportNodeSessionAlive", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Scheduled(cron = "5/35 * * * * *") // 30초 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "5/35 * * * * *") //
|
|
|
public void reportQueueInformation() {
|
|
public void reportQueueInformation() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|
|
@@ -100,7 +110,7 @@ public class ApplicationScheduler {
|
|
|
if (this.trace.isQueueReport()) {
|
|
if (this.trace.isQueueReport()) {
|
|
|
Elapsed elapsed = new Elapsed();
|
|
Elapsed elapsed = new Elapsed();
|
|
|
this.reportManager.reportQueueInfo(false);
|
|
this.reportManager.reportQueueInfo(false);
|
|
|
- log.info("{}", String.format("%25s: %s", "reportQueueInformation", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
|
|
|
|
+// log.info("{}", String.format("%25s: %s", "reportQueueInformation", TimeUtils.elapsedTimeStr(elapsed.nanoSeconds())));
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
this.reportManager.reportQueueInfo(true);
|
|
this.reportManager.reportQueueInfo(true);
|
|
@@ -119,7 +129,7 @@ public class ApplicationScheduler {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0/10 * * * * *") // 1분 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "10 * * * * *") //
|
|
|
public void loadTraceInfo() {
|
|
public void loadTraceInfo() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|
|
@@ -143,7 +153,7 @@ public class ApplicationScheduler {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0 * * * * *") // 1분 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "0 0/5 * * * *") //
|
|
|
public void loadBaseDatabase() {
|
|
public void loadBaseDatabase() {
|
|
|
if (!this.config.isStartup()) {
|
|
if (!this.config.isStartup()) {
|
|
|
return;
|
|
return;
|