Documentation ¶
Index ¶
- Variables
- func IsMuted(event *models.AlertCurEvent, clock ...int64) bool
- func LogEvent(event *models.AlertCurEvent, location string, err ...error)
- func Reload()
- func Report(errorType ErrorType)
- func Start(ctx context.Context) error
- func StringSetKeys(m map[string]struct{}) []string
- type AlertCurEventMap
- func (a *AlertCurEventMap) Delete(key string)
- func (a *AlertCurEventMap) Get(key string) (*models.AlertCurEvent, bool)
- func (a *AlertCurEventMap) GetAll() map[string]*models.AlertCurEvent
- func (a *AlertCurEventMap) Keys() []string
- func (a *AlertCurEventMap) Set(key string, value *models.AlertCurEvent)
- func (a *AlertCurEventMap) SetAll(data map[string]*models.AlertCurEvent)
- func (a *AlertCurEventMap) UpdateLastEvalTime(key string, lastEvalTime int64)
- type ErrorType
- type MaintainMessage
- type Notice
- type RecordingRuleEval
- type RuleEval
- func (r *RuleEval) Judge(clusterName string, vectors []conv.Vector)
- func (r *RuleEval) MakeNewEvent(from string, now int64, clusterName string, vectors []conv.Vector) (map[string]struct{}, bool)
- func (r *RuleEval) RecoverEvent(hash string, now int64, value float64)
- func (r *RuleEval) RuleID() int64
- func (r *RuleEval) Start()
- func (r *RuleEval) Stop()
- func (r *RuleEval) Work()
- type RuleEvalForExternalType
- type TaskCreateReply
- type TaskForm
- type WorkersType
Constants ¶
This section is empty.
Variables ¶
View Source
var EventQueue = list.NewSafeListLimited(10000000)
View Source
var RuleEvalForExternal = RuleEvalForExternalType{/* contains filtered or unexported fields */}
View Source
var Workers = &WorkersType{rules: make(map[string]*RuleEval), recordRules: make(map[string]RecordingRuleEval)}
Functions ¶
func IsMuted ¶ added in v5.9.7
func IsMuted(event *models.AlertCurEvent, clock ...int64) bool
如果传入了clock这个可选参数,就表示使用这个clock表示的时间,否则就从event的字段中取TriggerTime
func LogEvent ¶ added in v5.8.0
func LogEvent(event *models.AlertCurEvent, location string, err ...error)
func StringSetKeys ¶ added in v5.4.0
Types ¶
type AlertCurEventMap ¶ added in v5.11.0
type AlertCurEventMap struct { sync.RWMutex Data map[string]*models.AlertCurEvent }
func NewAlertCurEventMap ¶ added in v5.11.0
func NewAlertCurEventMap() *AlertCurEventMap
func (*AlertCurEventMap) Delete ¶ added in v5.11.0
func (a *AlertCurEventMap) Delete(key string)
func (*AlertCurEventMap) Get ¶ added in v5.11.0
func (a *AlertCurEventMap) Get(key string) (*models.AlertCurEvent, bool)
func (*AlertCurEventMap) GetAll ¶ added in v5.11.0
func (a *AlertCurEventMap) GetAll() map[string]*models.AlertCurEvent
func (*AlertCurEventMap) Keys ¶ added in v5.11.0
func (a *AlertCurEventMap) Keys() []string
func (*AlertCurEventMap) Set ¶ added in v5.11.0
func (a *AlertCurEventMap) Set(key string, value *models.AlertCurEvent)
func (*AlertCurEventMap) SetAll ¶ added in v5.11.0
func (a *AlertCurEventMap) SetAll(data map[string]*models.AlertCurEvent)
func (*AlertCurEventMap) UpdateLastEvalTime ¶ added in v5.11.0
func (a *AlertCurEventMap) UpdateLastEvalTime(key string, lastEvalTime int64)
type MaintainMessage ¶ added in v5.9.7
type Notice ¶
type Notice struct { Event *models.AlertCurEvent `json:"event"` Tpls map[string]string `json:"tpls"` }
type RecordingRuleEval ¶ added in v5.9.5
type RecordingRuleEval struct {
// contains filtered or unexported fields
}
func (RecordingRuleEval) RuleID ¶ added in v5.9.5
func (r RecordingRuleEval) RuleID() int64
func (RecordingRuleEval) Start ¶ added in v5.9.5
func (r RecordingRuleEval) Start()
func (RecordingRuleEval) Stop ¶ added in v5.9.5
func (r RecordingRuleEval) Stop()
func (RecordingRuleEval) Work ¶ added in v5.9.5
func (r RecordingRuleEval) Work()
type RuleEval ¶
type RuleEval struct {
// contains filtered or unexported fields
}
func (*RuleEval) MakeNewEvent ¶ added in v5.11.0
func (*RuleEval) RecoverEvent ¶ added in v5.11.0
type RuleEvalForExternalType ¶ added in v5.11.0
func (*RuleEvalForExternalType) Build ¶ added in v5.11.0
func (re *RuleEvalForExternalType) Build()
type TaskCreateReply ¶
type TaskForm ¶
type TaskForm struct { Title string `json:"title"` Account string `json:"account"` Batch int `json:"batch"` Tolerance int `json:"tolerance"` Timeout int `json:"timeout"` Pause string `json:"pause"` Script string `json:"script"` Args string `json:"args"` Action string `json:"action"` Creator string `json:"creator"` Hosts []string `json:"hosts"` }
type WorkersType ¶
type WorkersType struct {
// contains filtered or unexported fields
}
func (*WorkersType) Build ¶
func (ws *WorkersType) Build(rids []int64)
func (*WorkersType) BuildRe ¶ added in v5.9.5
func (ws *WorkersType) BuildRe(rids []int64)
Click to show internal directories.
Click to hide internal directories.