Skip to content

Commit

Permalink
[horus] Modify the naming (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody authored Sep 25, 2024
1 parent b01d46e commit b8edeeb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions app/horus/basic/config/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type SlackConfiguration struct {
type RecoveryConfiguration struct {
Enabled bool `yaml:"enabled"`
DayNumber int `yaml:"dayNumber"`
CheckIntervalSecond int `yaml:"checkIntervalSecond"`
IntervalSecond int `yaml:"intervalSecond"`
PromQueryTimeSecond int64 `yaml:"promQueryTimeSecond"`
DingTalk *DingTalkConfiguration `yaml:"dingTalk"`
Slack *SlackConfiguration `yaml:"slack"`
Expand All @@ -68,7 +68,7 @@ type ModularConfiguration struct {

type DowntimeConfiguration struct {
Enabled bool `yaml:"enabled"`
CheckIntervalSecond int `yaml:"checkIntervalSecond"`
IntervalSecond int `yaml:"intervalSecond"`
PromQueryTimeSecond int64 `yaml:"promQueryTimeSecond"`
KubeMultiple map[string]string `yaml:"kubeMultiple"`
AbnormalityQL []string `yaml:"abnormalityQL"`
Expand All @@ -77,11 +77,11 @@ type DowntimeConfiguration struct {
}

type AbnormalConfiguration struct {
Enabled bool `yaml:"enabled"`
CheckIntervalSecond int `yaml:"checkIntervalSecond"`
CheckDoubleSecond int `yaml:"checkDoubleSecond"`
LabelSelector string `yaml:"labelSelector"`
FieldSelector string `yaml:"fieldSelector"`
KubeMultiple map[string]string `yaml:"kubeMultiple"`
DingTalk *DingTalkConfiguration `yaml:"dingTalk"`
Enabled bool `yaml:"enabled"`
IntervalSecond int `yaml:"intervalSecond"`
DoubleSecond int `yaml:"doubleSecond"`
LabelSelector string `yaml:"labelSelector"`
FieldSelector string `yaml:"fieldSelector"`
KubeMultiple map[string]string `yaml:"kubeMultiple"`
DingTalk *DingTalkConfiguration `yaml:"dingTalk"`
}
6 changes: 3 additions & 3 deletions app/horus/core/horuser/downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
)

func (h *Horuser) DownTimeManager(ctx context.Context) error {
go wait.UntilWithContext(ctx, h.DownTimeCheck, time.Duration(h.cc.NodeDownTime.CheckIntervalSecond)*time.Second)
go wait.UntilWithContext(ctx, h.DownTimeCheck, time.Duration(h.cc.NodeDownTime.IntervalSecond)*time.Second)
<-ctx.Done()
return nil
}
Expand Down Expand Up @@ -137,9 +137,9 @@ func (h *Horuser) DownTimeNodes(clusterName, addr string) {
write.FirstDate = today
_, err = write.Add()
if err != nil {
klog.Errorf("NodeDownTimeCheckOnCluster abnormal cordonNode AddOrGetOne err:%v", err)
klog.Errorf("DownTimeNodes abnormal cordonNode AddOrGetOne err:%v", err)
klog.Infof("cluster:%v node:%v", clusterName, nodeName)
}
klog.Infof("NodeDownTimeCheckOnCluster abnormal cordonNode AddOrGetOne cluster:%v node:%v", clusterName, nodeName)
klog.Infof("DownTimeNodes abnormal cordonNode AddOrGetOne cluster:%v node:%v", clusterName, nodeName)
}
}
2 changes: 1 addition & 1 deletion app/horus/core/horuser/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

func (h *Horuser) RecoveryManager(ctx context.Context) error {
go wait.UntilWithContext(ctx, h.recoveryCheck, time.Duration(h.cc.NodeRecovery.CheckIntervalSecond)*time.Second)
go wait.UntilWithContext(ctx, h.recoveryCheck, time.Duration(h.cc.NodeRecovery.IntervalSecond)*time.Second)
<-ctx.Done()
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion app/horus/core/horuser/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

func (h *Horuser) DowntimeRestartManager(ctx context.Context) error {
go wait.UntilWithContext(ctx, h.RestartOrRepair, time.Duration(h.cc.NodeDownTime.CheckIntervalSecond)*time.Second)
go wait.UntilWithContext(ctx, h.RestartOrRepair, time.Duration(h.cc.NodeDownTime.IntervalSecond)*time.Second)
<-ctx.Done()
return nil
}
Expand Down

0 comments on commit b8edeeb

Please sign in to comment.