Versions in this module Expand all Collapse all v4 v4.0.4 Aug 4, 2021 v4.0.3 Jun 27, 2021 v4.0.2 Jun 1, 2021 v4.0.1 Apr 19, 2021 v4.0.0 Apr 15, 2021 Changes in this version + var DefaultSendQueueMaxSize = 102400 + var DefaultSendTaskSleepInterval = time.Millisecond * 50 + var EVENT_ALERT = "alert" + var EVENT_RECOVER = "recovery" + var Ident string + var JudgeConfig JudgeSection + var JudgeConnPools *pools.ConnPools + var JudgeQueues = cache.SafeJudgeQueue + var MaxSendRetry = 10 + func AsyncJudge(sema *semaphore.Semaphore, stra *models.Stra, exps []models.Exp, ...) + func GetData(stra *models.Stra, exp models.Exp, firstItem *dataobj.JudgeItem, now int64) ([]*dataobj.TsdbQueryResponse, error) + func GetJudges() []string + func GetReqs(stra *models.Stra, metric string, nids, endpoints []string, now int64) []*dataobj.QueryData + func GetStra(sid int64) (*models.Stra, bool) + func InitJudge(section JudgeSection, ident string) + func Judge(stra *models.Stra, exp models.Exp, historyData []*dataobj.HistoryData, ...) (history dataobj.History, info string, lastValue string, status bool) + func NodataJudge(concurrency int) + func Push2JudgeQueue(items []*dataobj.MetricValue) + func Send(items []*dataobj.JudgeItem) + func Send2JudgeTask(Q *list.SafeListLimited, addr string, concurrent int) + func TagMatch(straTags []models.Tag, tag map[string]string) bool + func ToJudge(historyMap *cache.JudgeItemMap, key string, val *dataobj.JudgeItem, now int64) + type AllFunction struct + Limit int + Operator string + RightValue float64 + func (f AllFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type AvgFunction struct + Limit int + Operator string + RightValue float64 + func (f AvgFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type CAvgAbsFunction struct + CompareValue float64 + Limit int + Operator string + RightValue float64 + func (f CAvgAbsFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type CAvgFunction struct + CompareValue float64 + Limit int + Operator string + RightValue float64 + func (f CAvgFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type CAvgRateAbsFunction struct + CompareValue float64 + Limit int + Operator string + RightValue float64 + func (f CAvgRateAbsFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type CAvgRateFunction struct + CompareValue float64 + Limit int + Operator string + RightValue float64 + func (f CAvgRateFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type DiffFunction struct + Limit int + Operator string + RightValue float64 + func (f DiffFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type Function interface + Compute func(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + func ParseFuncFromString(str string, span []interface{}, operator string, rightValue float64) (fn Function, err error) + type HappenFunction struct + Limit int + Num int + Operator string + RightValue float64 + func (f HappenFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type JudgeSection struct + Batch int + CallTimeout int + ConnTimeout int + EventPrefix string + HbsMod string + MaxConns int + MaxIdle int + WorkerNum int + type MaxFunction struct + Limit int + Operator string + RightValue float64 + func (f MaxFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type MinFunction struct + Limit int + Operator string + RightValue float64 + func (f MinFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type NodataFunction struct + func (f NodataFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type PDiffFunction struct + Limit int + Operator string + RightValue float64 + func (f PDiffFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type StddevFunction struct + Limit int + Num int + func (f StddevFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool) + type SumFunction struct + Limit int + Operator string + RightValue float64 + func (f SumFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)