Documentation
¶
Index ¶
- Variables
- func Alerter(in <-chan string)
- func InitAlert()
- func InitHistoryBigMap()
- func InitRedisConnPool(url string)
- func PingRedis(c redis.Conn, t time.Time) error
- type AlertConfig
- type AllFunction
- type Function
- type JudgeItemMap
- func (this *JudgeItemMap) BatchDelete(keys []string)
- func (this *JudgeItemMap) CleanStale(before int64)
- func (this *JudgeItemMap) Delete(key string)
- func (this *JudgeItemMap) Get(key string) (*SafeLinkedList, bool)
- func (this *JudgeItemMap) Len() int
- func (this *JudgeItemMap) PushFrontAndMaintain(key string, val *model.MetricValue, maxCount int, now int64)
- func (this *JudgeItemMap) Set(key string, val *SafeLinkedList)
- type SafeLinkedList
- func (this *SafeLinkedList) Elem(offset int) *list.Element
- func (this *SafeLinkedList) Front() *list.Element
- func (this *SafeLinkedList) Len() int
- func (this *SafeLinkedList) PushFront(v interface{}) *list.Element
- func (this *SafeLinkedList) PushFrontAndMaintain(v *model.MetricValue, maxCount int) bool
- func (this *SafeLinkedList) ToSlice() []*model.MetricValue
- func (this *SafeLinkedList) Values() []float64
Constants ¶
This section is empty.
Variables ¶
View Source
var HistoryBigMap = make(map[string]*JudgeItemMap)
这是个线程不安全的大Map,需要提前初始化好
View Source
var RedisConnPool *redis.Pool
Functions ¶
func InitHistoryBigMap ¶
func InitHistoryBigMap()
func InitRedisConnPool ¶
func InitRedisConnPool(url string)
Types ¶
type AlertConfig ¶
type AllFunction ¶
func (AllFunction) Compute ¶
func (this AllFunction) Compute(L *SafeLinkedList) (isTriggered bool)
type Function ¶
type Function interface {
Compute(L *SafeLinkedList) (isTriggered bool)
}
type JudgeItemMap ¶
type JudgeItemMap struct { sync.RWMutex M map[string]*SafeLinkedList }
func NewJudgeItemMap ¶
func NewJudgeItemMap() *JudgeItemMap
func (*JudgeItemMap) BatchDelete ¶
func (this *JudgeItemMap) BatchDelete(keys []string)
func (*JudgeItemMap) CleanStale ¶
func (this *JudgeItemMap) CleanStale(before int64)
func (*JudgeItemMap) Delete ¶
func (this *JudgeItemMap) Delete(key string)
func (*JudgeItemMap) Get ¶
func (this *JudgeItemMap) Get(key string) (*SafeLinkedList, bool)
func (*JudgeItemMap) Len ¶
func (this *JudgeItemMap) Len() int
func (*JudgeItemMap) PushFrontAndMaintain ¶
func (this *JudgeItemMap) PushFrontAndMaintain(key string, val *model.MetricValue, maxCount int, now int64)
func (*JudgeItemMap) Set ¶
func (this *JudgeItemMap) Set(key string, val *SafeLinkedList)
type SafeLinkedList ¶
func (*SafeLinkedList) Front ¶
func (this *SafeLinkedList) Front() *list.Element
func (*SafeLinkedList) Len ¶
func (this *SafeLinkedList) Len() int
func (*SafeLinkedList) PushFront ¶
func (this *SafeLinkedList) PushFront(v interface{}) *list.Element
func (*SafeLinkedList) PushFrontAndMaintain ¶
func (this *SafeLinkedList) PushFrontAndMaintain(v *model.MetricValue, maxCount int) bool
@return needJudge 如果是false不需要做judge,因为新上来的数据不合法
func (*SafeLinkedList) ToSlice ¶
func (this *SafeLinkedList) ToSlice() []*model.MetricValue
func (*SafeLinkedList) Values ¶
func (this *SafeLinkedList) Values() []float64
Click to show internal directories.
Click to hide internal directories.