|
@@ -1840,15 +1840,12 @@ func saveTimeWindow(faultLabel string, faultHappenTime string, lastTimeWindow *c
|
|
|
commonEntity.TimeWindowProducerQueueMutex.RLock()
|
|
|
defer commonEntity.TimeWindowProducerQueueMutex.RUnlock()
|
|
|
// 更新故障窗口end时间
|
|
|
- latestEnd := util.TimeCustomChange(lastTimeWindow.TimeWindowBegin, commonConfig.PlatformConfig.TaskMaxTime) // 窗口最晚关闭时间是窗口开启时间加上最大任务时间
|
|
|
- expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime) // 窗口期望关闭时间是触发时间加上后置时间
|
|
|
- if util.TimeCustom1GreaterTimeCustom2(expectEnd, latestEnd) {
|
|
|
- latestTimeWindowEnd = latestEnd
|
|
|
+ expectEnd := util.TimeCustomChange(faultHappenTime, commonConfig.PlatformConfig.TaskAfterTime) // 窗口期望关闭时间是触发时间加上后置时间
|
|
|
+ expectLength := util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, expectEnd)
|
|
|
+ if expectLength < commonConfig.PlatformConfig.TaskMaxTime {
|
|
|
+ latestTimeWindowEnd = expectEnd
|
|
|
lastTimeWindow.TimeWindowEnd = latestTimeWindowEnd
|
|
|
lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
|
|
|
- } else {
|
|
|
- lastTimeWindow.TimeWindowEnd = expectEnd
|
|
|
- lastTimeWindow.Length = util.CalculateDifferenceOfTimeCustom(lastTimeWindow.TimeWindowBegin, lastTimeWindow.TimeWindowEnd)
|
|
|
}
|
|
|
// 更新label
|
|
|
labels := lastTimeWindow.Labels
|