Change circle interval to crontab expression.

This commit is contained in:
MikoyChinese
2022-01-11 18:15:43 +08:00
parent 3a916886e8
commit 9af8bb8c18
2 changed files with 29 additions and 8 deletions

View File

@@ -38,10 +38,11 @@ func addCycleTransferStatsInfo(alert *model.AlertRule) {
}
if AlertsCycleTransferStatsStore[alert.ID] == nil {
from := alert.Rules[j].GetTransferDurationStart()
to := alert.Rules[j].GetTransferDurationEnd()
AlertsCycleTransferStatsStore[alert.ID] = &model.CycleTransferStats{
Name: alert.Name,
From: from,
To: from.Add(time.Hour * time.Duration(alert.Rules[j].CycleInterval)),
To: to,
Max: uint64(alert.Rules[j].Max),
Min: uint64(alert.Rules[j].Min),
ServerName: make(map[uint64]string),