|
@@ -1,14 +1,12 @@
|
|
-package svc
|
|
|
|
|
|
+package service
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ commonConfig "cicv-data-closedloop/aarch64/kinglong/common/config"
|
|
|
|
+ "cicv-data-closedloop/aarch64/kinglong/common/service"
|
|
|
|
+ masterConfig "cicv-data-closedloop/aarch64/kinglong/master/package/config"
|
|
"cicv-data-closedloop/common/config/c_log"
|
|
"cicv-data-closedloop/common/config/c_log"
|
|
- commonConfig "cicv-data-closedloop/kinglong/common/cfg"
|
|
|
|
- "cicv-data-closedloop/kinglong/common/ent"
|
|
|
|
- "cicv-data-closedloop/kinglong/common/global"
|
|
|
|
- "cicv-data-closedloop/kinglong/common/log"
|
|
|
|
- "cicv-data-closedloop/kinglong/common/svc"
|
|
|
|
- "cicv-data-closedloop/kinglong/common/util"
|
|
|
|
- masterConfig "cicv-data-closedloop/kinglong/master/pkg/cfg"
|
|
|
|
|
|
+ "cicv-data-closedloop/common/entity"
|
|
|
|
+ "cicv-data-closedloop/common/util"
|
|
"cicv-data-closedloop/kinglong_msgs"
|
|
"cicv-data-closedloop/kinglong_msgs"
|
|
"github.com/bluenviron/goroslib/v2"
|
|
"github.com/bluenviron/goroslib/v2"
|
|
"os"
|
|
"os"
|
|
@@ -30,42 +28,42 @@ var (
|
|
|
|
|
|
// PrepareTimeWindowProducerQueue 负责监听所有主题并修改时间窗口
|
|
// PrepareTimeWindowProducerQueue 负责监听所有主题并修改时间窗口
|
|
func PrepareTimeWindowProducerQueue() {
|
|
func PrepareTimeWindowProducerQueue() {
|
|
- log.GlobalLogger.Info("订阅者 goroutine,启动。")
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("订阅者 goroutine,启动。")
|
|
//创建订阅者0订阅主题 nodefault_info
|
|
//创建订阅者0订阅主题 nodefault_info
|
|
- log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfNodeFaultInfo)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfNodeFaultInfo)
|
|
subscriber0, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
subscriber0, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
Node: commonConfig.RosNode,
|
|
Node: commonConfig.RosNode,
|
|
Topic: masterConfig.TopicOfNodeFaultInfo,
|
|
Topic: masterConfig.TopicOfNodeFaultInfo,
|
|
Callback: func(data *kinglong_msgs.FaultInfo) {
|
|
Callback: func(data *kinglong_msgs.FaultInfo) {
|
|
if len(masterConfig.RuleOfNodefaultInfo) == 0 {
|
|
if len(masterConfig.RuleOfNodefaultInfo) == 0 {
|
|
- //log.GlobalLogger.Info("话题 nodefault_info没有触发器")
|
|
|
|
|
|
+ //c_log.GlobalLogger.Info("话题 nodefault_info没有触发器")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- global.Subscriber0TimeMutex.Lock()
|
|
|
|
- if time.Since(global.Subscriber0Time).Seconds() > 1 {
|
|
|
|
- global.Subscriber0TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber0TimeMutex.Lock()
|
|
|
|
+ if time.Since(entity.Subscriber0Time).Seconds() > 1 {
|
|
|
|
+ entity.Subscriber0TimeMutex.Unlock()
|
|
subscriber0Mutex.Lock()
|
|
subscriber0Mutex.Lock()
|
|
- faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
- lastTimeWindow := util.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
|
|
|
+ faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
+ lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
var faultLabel string
|
|
var faultLabel string
|
|
for _, f := range masterConfig.RuleOfNodefaultInfo {
|
|
for _, f := range masterConfig.RuleOfNodefaultInfo {
|
|
faultLabel = f(data)
|
|
faultLabel = f(data)
|
|
if faultLabel != "" {
|
|
if faultLabel != "" {
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
- global.Subscriber0Time = time.Now()
|
|
|
|
|
|
+ entity.Subscriber0Time = time.Now()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
subscriber0Mutex.Unlock()
|
|
subscriber0Mutex.Unlock()
|
|
}
|
|
}
|
|
- global.Subscriber0TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber0TimeMutex.Unlock()
|
|
}})
|
|
}})
|
|
if err != nil {
|
|
if err != nil {
|
|
- log.GlobalLogger.Info("创建订阅者发生故障:", err)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者发生故障:", err)
|
|
os.Exit(-1)
|
|
os.Exit(-1)
|
|
}
|
|
}
|
|
// 创建订阅者1订阅主题 cicv_location
|
|
// 创建订阅者1订阅主题 cicv_location
|
|
- log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfCicvLocation)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfCicvLocation)
|
|
subscriber1, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
subscriber1, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
Node: commonConfig.RosNode,
|
|
Node: commonConfig.RosNode,
|
|
Topic: masterConfig.TopicOfCicvLocation,
|
|
Topic: masterConfig.TopicOfCicvLocation,
|
|
@@ -77,138 +75,138 @@ func PrepareTimeWindowProducerQueue() {
|
|
m.RUnlock()
|
|
m.RUnlock()
|
|
|
|
|
|
if len(masterConfig.RuleOfCicvLocation) == 0 {
|
|
if len(masterConfig.RuleOfCicvLocation) == 0 {
|
|
- log.GlobalLogger.Info("话题 cicv_location 没有触发器")
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("话题 cicv_location 没有触发器")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- global.Subscriber1TimeMutex.Lock()
|
|
|
|
- if time.Since(global.Subscriber1Time).Seconds() > 1 {
|
|
|
|
|
|
+ entity.Subscriber1TimeMutex.Lock()
|
|
|
|
+ if time.Since(entity.Subscriber1Time).Seconds() > 1 {
|
|
subscriber1Mutex.Lock()
|
|
subscriber1Mutex.Lock()
|
|
- faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
- lastTimeWindow := util.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
|
|
|
+ faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
+ lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
// 更新共享变量
|
|
// 更新共享变量
|
|
var faultLabel string
|
|
var faultLabel string
|
|
for _, f := range masterConfig.RuleOfCicvLocation {
|
|
for _, f := range masterConfig.RuleOfCicvLocation {
|
|
faultLabel = f(data)
|
|
faultLabel = f(data)
|
|
if faultLabel != "" {
|
|
if faultLabel != "" {
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
- global.Subscriber1Time = time.Now()
|
|
|
|
|
|
+ entity.Subscriber1Time = time.Now()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
subscriber1Mutex.Unlock()
|
|
subscriber1Mutex.Unlock()
|
|
}
|
|
}
|
|
- global.Subscriber1TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber1TimeMutex.Unlock()
|
|
},
|
|
},
|
|
})
|
|
})
|
|
if err != nil {
|
|
if err != nil {
|
|
- log.GlobalLogger.Info("创建订阅者发生故障:", err)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者发生故障:", err)
|
|
os.Exit(-1)
|
|
os.Exit(-1)
|
|
}
|
|
}
|
|
- log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfTpperception)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者订阅话题 ", masterConfig.TopicOfTpperception)
|
|
subscriber2, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
subscriber2, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
Node: commonConfig.RosNode,
|
|
Node: commonConfig.RosNode,
|
|
Topic: masterConfig.TopicOfTpperception,
|
|
Topic: masterConfig.TopicOfTpperception,
|
|
Callback: func(data *kinglong_msgs.PerceptionObjects) {
|
|
Callback: func(data *kinglong_msgs.PerceptionObjects) {
|
|
if len(masterConfig.RuleOfTpperception) == 0 {
|
|
if len(masterConfig.RuleOfTpperception) == 0 {
|
|
- log.GlobalLogger.Info("话题 tpperception 没有触发器")
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("话题 tpperception 没有触发器")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- global.Subscriber2TimeMutex.Lock()
|
|
|
|
|
|
+ entity.Subscriber2TimeMutex.Lock()
|
|
// 判断是否是连续故障码
|
|
// 判断是否是连续故障码
|
|
- if time.Since(global.Subscriber2Time).Seconds() > 1 {
|
|
|
|
|
|
+ if time.Since(entity.Subscriber2Time).Seconds() > 1 {
|
|
// 2 不是连续故障码
|
|
// 2 不是连续故障码
|
|
subscriber2Mutex.Lock()
|
|
subscriber2Mutex.Lock()
|
|
- faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
- lastTimeWindow := util.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
|
|
|
+ faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
+ lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
var faultLabel string
|
|
var faultLabel string
|
|
- //log.GlobalLogger.Infof("TTC数据为:【velocityX】=%v,【velocityY】=%v", velocityX, velocityY)
|
|
|
|
|
|
+ //c_log.GlobalLogger.Infof("TTC数据为:【velocityX】=%v,【velocityY】=%v", velocityX, velocityY)
|
|
for _, f := range masterConfig.RuleOfTpperception {
|
|
for _, f := range masterConfig.RuleOfTpperception {
|
|
faultLabel = f(data, velocityX, velocityY, yaw)
|
|
faultLabel = f(data, velocityX, velocityY, yaw)
|
|
if faultLabel != "" {
|
|
if faultLabel != "" {
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
- global.Subscriber2Time = time.Now()
|
|
|
|
|
|
+ entity.Subscriber2Time = time.Now()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
subscriber2Mutex.Unlock()
|
|
subscriber2Mutex.Unlock()
|
|
}
|
|
}
|
|
- global.Subscriber2TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber2TimeMutex.Unlock()
|
|
}})
|
|
}})
|
|
if err != nil {
|
|
if err != nil {
|
|
c_log.GlobalLogger.Info("创建订阅者2发生故障:", err)
|
|
c_log.GlobalLogger.Info("创建订阅者2发生故障:", err)
|
|
os.Exit(-1)
|
|
os.Exit(-1)
|
|
}
|
|
}
|
|
// 创建订阅者3订阅主题 fault_info
|
|
// 创建订阅者3订阅主题 fault_info
|
|
- log.GlobalLogger.Info("创建订阅者3订阅话题 ", masterConfig.TopicOfFaultInfo)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者3订阅话题 ", masterConfig.TopicOfFaultInfo)
|
|
subscriber3, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
subscriber3, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
Node: commonConfig.RosNode,
|
|
Node: commonConfig.RosNode,
|
|
Topic: masterConfig.TopicOfFaultInfo,
|
|
Topic: masterConfig.TopicOfFaultInfo,
|
|
Callback: func(data *kinglong_msgs.FaultVec) {
|
|
Callback: func(data *kinglong_msgs.FaultVec) {
|
|
if len(masterConfig.RuleOfFaultInfo) == 0 {
|
|
if len(masterConfig.RuleOfFaultInfo) == 0 {
|
|
- log.GlobalLogger.Info("话题 fault_info 没有触发器")
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("话题 fault_info 没有触发器")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- global.Subscriber3TimeMutex.Lock()
|
|
|
|
- if time.Since(global.Subscriber3Time).Seconds() > 1 {
|
|
|
|
|
|
+ entity.Subscriber3TimeMutex.Lock()
|
|
|
|
+ if time.Since(entity.Subscriber3Time).Seconds() > 1 {
|
|
// 2 不是连续故障码
|
|
// 2 不是连续故障码
|
|
subscriber3Mutex.Lock()
|
|
subscriber3Mutex.Lock()
|
|
- faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
- lastTimeWindow := util.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
|
|
|
+ faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
+ lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
var faultLabel string
|
|
var faultLabel string
|
|
for _, f := range masterConfig.RuleOfFaultInfo {
|
|
for _, f := range masterConfig.RuleOfFaultInfo {
|
|
faultLabel = f(data)
|
|
faultLabel = f(data)
|
|
if faultLabel != "" {
|
|
if faultLabel != "" {
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
- global.Subscriber3Time = time.Now()
|
|
|
|
|
|
+ entity.Subscriber3Time = time.Now()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
subscriber3Mutex.Unlock()
|
|
subscriber3Mutex.Unlock()
|
|
}
|
|
}
|
|
- global.Subscriber3TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber3TimeMutex.Unlock()
|
|
}})
|
|
}})
|
|
if err != nil {
|
|
if err != nil {
|
|
- log.GlobalLogger.Info("创建订阅者3发生故障:", err)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者3发生故障:", err)
|
|
os.Exit(-1)
|
|
os.Exit(-1)
|
|
}
|
|
}
|
|
// 创建订阅者4订阅主题 data_read
|
|
// 创建订阅者4订阅主题 data_read
|
|
// TODO 高频率触发
|
|
// TODO 高频率触发
|
|
- log.GlobalLogger.Info("创建订阅者4订阅话题 ", masterConfig.TopicOfDataRead)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者4订阅话题 ", masterConfig.TopicOfDataRead)
|
|
subscriber4, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
subscriber4, err := goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
Node: commonConfig.RosNode,
|
|
Node: commonConfig.RosNode,
|
|
Topic: masterConfig.TopicOfDataRead,
|
|
Topic: masterConfig.TopicOfDataRead,
|
|
Callback: func(data *kinglong_msgs.Retrieval) {
|
|
Callback: func(data *kinglong_msgs.Retrieval) {
|
|
if len(masterConfig.RuleOfDataRead) == 0 {
|
|
if len(masterConfig.RuleOfDataRead) == 0 {
|
|
- //log.GlobalLogger.Info("话题 data_read 没有触发器")
|
|
|
|
|
|
+ //c_log.GlobalLogger.Info("话题 data_read 没有触发器")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- global.Subscriber4TimeMutex.Lock()
|
|
|
|
- if time.Since(global.Subscriber4Time).Seconds() > 1 {
|
|
|
|
|
|
+ entity.Subscriber4TimeMutex.Lock()
|
|
|
|
+ if time.Since(entity.Subscriber4Time).Seconds() > 1 {
|
|
subscriber4Mutex.Lock()
|
|
subscriber4Mutex.Lock()
|
|
- faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
- lastTimeWindow := util.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
|
|
|
|
+ faultHappenTime := util.GetNowTimeCustom() // 获取当前故障发生时间
|
|
|
|
+ lastTimeWindow := entity.GetLastTimeWindow() // 获取最后一个时间窗口
|
|
var faultLabel string
|
|
var faultLabel string
|
|
for _, f := range masterConfig.RuleOfDataRead {
|
|
for _, f := range masterConfig.RuleOfDataRead {
|
|
faultLabel = f(data)
|
|
faultLabel = f(data)
|
|
if faultLabel != "" {
|
|
if faultLabel != "" {
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
saveTimeWindow(faultLabel, faultHappenTime, lastTimeWindow)
|
|
- global.Subscriber4Time = time.Now()
|
|
|
|
|
|
+ entity.Subscriber4Time = time.Now()
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
subscriber4Mutex.Unlock()
|
|
subscriber4Mutex.Unlock()
|
|
}
|
|
}
|
|
- global.Subscriber4TimeMutex.Unlock()
|
|
|
|
|
|
+ entity.Subscriber4TimeMutex.Unlock()
|
|
},
|
|
},
|
|
})
|
|
})
|
|
if err != nil {
|
|
if err != nil {
|
|
- log.GlobalLogger.Info("创建订阅者3发生故障:", err)
|
|
|
|
|
|
+ c_log.GlobalLogger.Info("创建订阅者3发生故障:", err)
|
|
os.Exit(-1)
|
|
os.Exit(-1)
|
|
}
|
|
}
|
|
select {
|
|
select {
|
|
- case signal := <-svc.ChannelKillWindowProducer:
|
|
|
|
|
|
+ case signal := <-service.ChannelKillWindowProducer:
|
|
if signal == 1 {
|
|
if signal == 1 {
|
|
- defer svc.AddKillTimes("3")
|
|
|
|
|
|
+ defer service.AddKillTimes("3")
|
|
subscriber0.Close()
|
|
subscriber0.Close()
|
|
subscriber1.Close()
|
|
subscriber1.Close()
|
|
subscriber2.Close()
|
|
subscriber2.Close()
|
|
@@ -220,11 +218,11 @@ func PrepareTimeWindowProducerQueue() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *ent.TimeWindow) {
|
|
|
|
|
|
+func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *entity.TimeWindow) {
|
|
masterTopics, slaveTopics := getTopicsOfNode(faultLabel)
|
|
masterTopics, slaveTopics := getTopicsOfNode(faultLabel)
|
|
if lastTimeWindow == nil || util.TimeCustom1GreaterTimeCustom2(faultHappenTime, lastTimeWindow.TimeWindowEnd) {
|
|
if lastTimeWindow == nil || util.TimeCustom1GreaterTimeCustom2(faultHappenTime, lastTimeWindow.TimeWindowEnd) {
|
|
// 2-1 如果是不在旧故障窗口内,添加一个新窗口
|
|
// 2-1 如果是不在旧故障窗口内,添加一个新窗口
|
|
- newTimeWindow := ent.TimeWindow{
|
|
|
|
|
|
+ newTimeWindow := entity.TimeWindow{
|
|
FaultTime: faultHappenTime,
|
|
FaultTime: faultHappenTime,
|
|
TimeWindowBegin: util.TimeCustomChange(faultHappenTime, -commonConfig.PlatformConfig.TaskBeforeTime),
|
|
TimeWindowBegin: util.TimeCustomChange(faultHappenTime, -commonConfig.PlatformConfig.TaskBeforeTime),
|
|
TimeWindowEnd: util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime),
|
|
TimeWindowEnd: util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime),
|
|
@@ -233,12 +231,12 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *e
|
|
MasterTopics: masterTopics,
|
|
MasterTopics: masterTopics,
|
|
SlaveTopics: slaveTopics,
|
|
SlaveTopics: slaveTopics,
|
|
}
|
|
}
|
|
- log.GlobalLogger.Infof("不在旧故障窗口内,向生产者队列添加一个新窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", newTimeWindow.Labels, newTimeWindow.FaultTime, newTimeWindow.Length)
|
|
|
|
- util.AddTimeWindowToTimeWindowProducerQueue(newTimeWindow)
|
|
|
|
|
|
+ c_log.GlobalLogger.Infof("不在旧故障窗口内,向生产者队列添加一个新窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", newTimeWindow.Labels, newTimeWindow.FaultTime, newTimeWindow.Length)
|
|
|
|
+ entity.AddTimeWindowToTimeWindowProducerQueue(newTimeWindow)
|
|
} else {
|
|
} else {
|
|
// 2-2 如果在旧故障窗口内
|
|
// 2-2 如果在旧故障窗口内
|
|
- global.TimeWindowProducerQueueMutex.RLock()
|
|
|
|
- defer global.TimeWindowProducerQueueMutex.RUnlock()
|
|
|
|
|
|
+ entity.TimeWindowProducerQueueMutex.RLock()
|
|
|
|
+ defer entity.TimeWindowProducerQueueMutex.RUnlock()
|
|
// 2-2-1 更新故障窗口end时间
|
|
// 2-2-1 更新故障窗口end时间
|
|
maxEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime)
|
|
maxEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime)
|
|
expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)
|
|
expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime)
|
|
@@ -259,7 +257,7 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *e
|
|
lastTimeWindow.MasterTopics = util.MergeSlice(sourceMasterTopics, masterTopics)
|
|
lastTimeWindow.MasterTopics = util.MergeSlice(sourceMasterTopics, masterTopics)
|
|
sourceSlaveTopics := lastTimeWindow.SlaveTopics
|
|
sourceSlaveTopics := lastTimeWindow.SlaveTopics
|
|
lastTimeWindow.SlaveTopics = util.MergeSlice(sourceSlaveTopics, slaveTopics)
|
|
lastTimeWindow.SlaveTopics = util.MergeSlice(sourceSlaveTopics, slaveTopics)
|
|
- log.GlobalLogger.Infof("在旧故障窗口内,更新生产者队列最新的窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", lastTimeWindow.Labels, lastTimeWindow.FaultTime, lastTimeWindow.Length)
|
|
|
|
|
|
+ c_log.GlobalLogger.Infof("在旧故障窗口内,更新生产者队列最新的窗口,【Lable】=%v,【FaultTime】=%v,【Length】=%v", lastTimeWindow.Labels, lastTimeWindow.FaultTime, lastTimeWindow.Length)
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|