Documentation ¶
Index ¶
- Variables
- func InitHistoryBigMap()
- type IndexMap
- type JudgeItemMap
- type SafeEventMap
- type SafeLinkedList
- func (ll *SafeLinkedList) Front() *list.Element
- func (ll *SafeLinkedList) HistoryData(limit int) ([]*dataobj.HistoryData, bool)
- func (ll *SafeLinkedList) Len() int
- func (ll *SafeLinkedList) PushFrontAndMaintain(v *dataobj.JudgeItem, maxCount int) bool
- func (ll *SafeLinkedList) QueryDataByTS(start, end int64) []*dataobj.HistoryData
- type Series
- type StrategyMap
Constants ¶
This section is empty.
Variables ¶
View Source
var HistoryBigMap = make(map[string]*JudgeItemMap)
这是个线程不安全的大Map,需要提前初始化好
View Source
var (
LastEvents = &SafeEventMap{M: make(map[string]*dataobj.Event)}
)
Functions ¶
func InitHistoryBigMap ¶
func InitHistoryBigMap()
Types ¶
type JudgeItemMap ¶
type JudgeItemMap struct { sync.RWMutex M map[string]*SafeLinkedList }
func NewJudgeItemMap ¶
func NewJudgeItemMap() *JudgeItemMap
func (*JudgeItemMap) BatchDelete ¶
func (j *JudgeItemMap) BatchDelete(keys []string)
func (*JudgeItemMap) CleanStale ¶
func (j *JudgeItemMap) CleanStale(before int64)
func (*JudgeItemMap) Get ¶
func (j *JudgeItemMap) Get(key string) (*SafeLinkedList, bool)
func (*JudgeItemMap) Len ¶
func (j *JudgeItemMap) Len() int
func (*JudgeItemMap) Set ¶
func (j *JudgeItemMap) Set(key string, val *SafeLinkedList)
type SafeEventMap ¶
type SafeLinkedList ¶
func (*SafeLinkedList) Front ¶
func (ll *SafeLinkedList) Front() *list.Element
func (*SafeLinkedList) HistoryData ¶
func (ll *SafeLinkedList) HistoryData(limit int) ([]*dataobj.HistoryData, bool)
@param limit 至多返回这些,如果不够,有多少返回多少 @return bool isEnough
func (*SafeLinkedList) Len ¶
func (ll *SafeLinkedList) Len() int
func (*SafeLinkedList) PushFrontAndMaintain ¶
func (ll *SafeLinkedList) PushFrontAndMaintain(v *dataobj.JudgeItem, maxCount int) bool
@return needJudge 如果是false不需要做judge,因为新上来的数据不合法
func (*SafeLinkedList) QueryDataByTS ¶ added in v1.4.0
func (ll *SafeLinkedList) QueryDataByTS(start, end int64) []*dataobj.HistoryData
type StrategyMap ¶
var NodataStra *StrategyMap
var Strategy *StrategyMap
func NewStrategyMap ¶
func NewStrategyMap() *StrategyMap
func (*StrategyMap) Clean ¶
func (s *StrategyMap) Clean()
func (*StrategyMap) GetAll ¶
func (s *StrategyMap) GetAll() []*model.Stra
Click to show internal directories.
Click to hide internal directories.