Documentation ¶
Index ¶
- Variables
- 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
- type AvgFunction
- type CAvgAbsFunction
- type CAvgFunction
- type CAvgRateAbsFunction
- type CAvgRateFunction
- type DiffFunction
- type Function
- type HappenFunction
- type JudgeSection
- type MaxFunction
- type MinFunction
- type NodataFunction
- type PDiffFunction
- type StddevFunction
- type SumFunction
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // config JudgeConfig JudgeSection Ident string // 连接池 node_address -> connection_pool JudgeConnPools *pools.ConnPools // queue JudgeQueues = cache.SafeJudgeQueue{} DefaultSendTaskSleepInterval = time.Millisecond * 50 //默认睡眠间隔为50ms DefaultSendQueueMaxSize = 102400 MaxSendRetry = 10 )
View Source
var ( EVENT_ALERT = "alert" EVENT_RECOVER = "recovery" )
Functions ¶
func AsyncJudge ¶
func InitJudge ¶
func InitJudge(section JudgeSection, ident string)
func NodataJudge ¶
func NodataJudge(concurrency int)
func Push2JudgeQueue ¶
func Push2JudgeQueue(items []*dataobj.MetricValue)
func Send2JudgeTask ¶
func Send2JudgeTask(Q *list.SafeListLimited, addr string, concurrent int)
Types ¶
type AllFunction ¶
func (AllFunction) Compute ¶
func (f AllFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type AvgFunction ¶
func (AvgFunction) Compute ¶
func (f AvgFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type CAvgAbsFunction ¶
type CAvgAbsFunction struct { Function Limit int Operator string RightValue float64 CompareValue float64 }
func (CAvgAbsFunction) Compute ¶
func (f CAvgAbsFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type CAvgFunction ¶
type CAvgFunction struct { Function Limit int Operator string RightValue float64 CompareValue float64 }
func (CAvgFunction) Compute ¶
func (f CAvgFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type CAvgRateAbsFunction ¶
type CAvgRateAbsFunction struct { Function Limit int Operator string RightValue float64 CompareValue float64 }
func (CAvgRateAbsFunction) Compute ¶
func (f CAvgRateAbsFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type CAvgRateFunction ¶
type CAvgRateFunction struct { Function Limit int Operator string RightValue float64 CompareValue float64 }
func (CAvgRateFunction) Compute ¶
func (f CAvgRateFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type DiffFunction ¶
func (DiffFunction) Compute ¶
func (f DiffFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
只要有一个点的diff触发阈值,就报警
type Function ¶
type Function interface {
Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
}
type HappenFunction ¶
func (HappenFunction) Compute ¶
func (f HappenFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type JudgeSection ¶
type MaxFunction ¶
func (MaxFunction) Compute ¶
func (f MaxFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type MinFunction ¶
func (MinFunction) Compute ¶
func (f MinFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type NodataFunction ¶
type NodataFunction struct {
Function
}
func (NodataFunction) Compute ¶
func (f NodataFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type PDiffFunction ¶
pdiff(#3)
func (PDiffFunction) Compute ¶
func (f PDiffFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type StddevFunction ¶
func (StddevFunction) Compute ¶
func (f StddevFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
type SumFunction ¶
func (SumFunction) Compute ¶
func (f SumFunction) Compute(vs []*dataobj.HistoryData) (leftValue dataobj.JsonFloat, isTriggered bool)
Click to show internal directories.
Click to hide internal directories.