Versions in this module Expand all Collapse all v4 v4.0.4 Aug 4, 2021 Changes in this version + func GetLeafNidsForMon(nid int64, exclNid []int64) ([]int64, error) + func GetRelatedNidsForMon(nid int64, exclNid []int64) ([]int64, error) + func SyncHashIdEventCur() + type HashIdEventCurMap struct + Data map[uint64]*models.EventCur + var HashIdEventCurMapCache *HashIdEventCurMap + func NewHashIdEventCurMapCache() *HashIdEventCurMap + func (t *HashIdEventCurMap) GetAll() []*models.EventCur + func (t *HashIdEventCurMap) GetBy(hashid uint64) *models.EventCur + func (t *HashIdEventCurMap) SetAll(objs map[uint64]*models.EventCur) + type NodeIdentsMap struct + Data map[int64][]*models.Resource + var NodeIdentsMapCache *NodeIdentsMap + func NewNodeIdentsMapCache() *NodeIdentsMap + func (t *NodeIdentsMap) GetBy(id int64) []*models.Resource + func (t *NodeIdentsMap) SetAll(objs map[int64][]*models.Resource) + type NodeResourceMap struct + Data map[int64][]int64 + var NodeResourceCache *NodeResourceMap + func NewNodeResourceCache() *NodeResourceMap + func (t *NodeResourceMap) GetByNids(ids []int64) []int64 + func (t *NodeResourceMap) GetResourceBy(id int64) []int64 + func (t *NodeResourceMap) SetAll(objs map[int64][]int64) + type ResourceMap struct + Data map[int64]*models.Resource + var ResourceCache *ResourceMap + func NewResourceCache() *ResourceMap + func (t *ResourceMap) GetBy(id int64) *models.Resource + func (t *ResourceMap) GetByIds(ids []int64) []*models.Resource + func (t *ResourceMap) SetAll(objs map[int64]*models.Resource) type TreeNodeMap + func (t *TreeNodeMap) GetAll() []*models.Node + func (t *TreeNodeMap) GetLeafNidsById(id int64) []int64 + func (t *TreeNodeMap) Len() int v4.0.3 Jun 27, 2021 v4.0.2 Jun 1, 2021 Changes in this version + type TeamMap struct + Data map[int64]*models.Team + var TeamCache *TeamMap + func NewTeamCache() *TeamMap + func (s *TeamMap) GetBy(id int64) *models.Team + func (s *TeamMap) GetByIds(ids []int64) []*models.Team + func (s *TeamMap) GetTeamNamesByIds(ids string) []string + func (s *TeamMap) SetAll(objs map[int64]*models.Team) + type TeamUsersMap struct + Data map[int64][]int64 + var TeamUsersCache *TeamUsersMap + func NewTeamUsersCache() *TeamUsersMap + func (s *TeamUsersMap) GetBy(id int64) []int64 + func (s *TeamUsersMap) GetByTeamIds(ids []int64) []int64 + func (s *TeamUsersMap) SetAll(data map[int64][]int64) + type TreeNodeMap struct + Data map[int64]*models.Node + var TreeNodeCache *TreeNodeMap + func NewTreeNodeCache() *TreeNodeMap + func (t *TreeNodeMap) GetBy(id int64) *models.Node + func (t *TreeNodeMap) GetByIds(ids []int64) []*models.Node + func (t *TreeNodeMap) SetAll(objs map[int64]*models.Node) + type UserMap struct + Data map[int64]*models.User + var UserCache *UserMap + func NewUserCache() *UserMap + func (s *UserMap) GetBy(id int64) *models.User + func (s *UserMap) GetByIds(ids []int64) []*models.User + func (s *UserMap) GetUsernamesByIds(ids string) []string + func (s *UserMap) SetAll(users map[int64]*models.User) v4.0.1 Apr 19, 2021 v4.0.0 Apr 15, 2021 Changes in this version + const CHECK_INTERVAL + const DetectorReplicas + const JudgesReplicas + const ProbersReplicas + var ActiveJudgeNode = NewNodeMap() + var AggrCalcMap = &SafeAggrCalcMap + var ApiDetectorHashRing map[string]*ConsistentHashRing + var CollectRuleCache *collectRuleCache + var CommonModule string + var DefaultCache = &Cache + var HistoryBigMap = make(map[string]*JudgeItemMap) + var LastEvents = &SafeEventMap + var SnmpDetectorHashRing map[string]*ConsistentHashRing + var StraMap = &SafeStraMap + func AuthConfig() *models.AuthConfig + func Init(regions []string) + func InitApiDetectorHashRing(regions []string) + func InitHistoryBigMap() + func InitJudgeHashRing() + func InitSnmpDetectorHashRing(regions []string) + func LoadFile() (map[string][]*dataobj.Metric, error) + func LoadMetrics() + func NewCollectRuleCache(regions []string) *collectRuleCache + func RebuildConsistentHashRing(hashRing *ConsistentHashRing, nodes []string, replicas int) + func Start() + func Stop() + type AggrCalcCacheMap struct + Data []*models.AggrCalc + var AggrCalcStraCache *AggrCalcCacheMap + func NewAggrCalcStraCache() *AggrCalcCacheMap + func (a *AggrCalcCacheMap) Get() []*models.AggrCalc + func (a *AggrCalcCacheMap) Set(stras []*models.AggrCalc) + type AlarmStraCacheMap struct + Data map[int64]*models.Stra + var AlarmStraCache *AlarmStraCacheMap + func NewAlarmStraCache() *AlarmStraCacheMap + func (this *AlarmStraCacheMap) GetById(id int64) (*models.Stra, bool) + func (this *AlarmStraCacheMap) SetAll(m map[int64]*models.Stra) + type ApiCollectCacheMap struct + Data map[string][]*models.ApiCollect + var ApiCollectCache *ApiCollectCacheMap + func NewApiCollectCache() *ApiCollectCacheMap + func (c *ApiCollectCacheMap) GetBy(node string) []*models.ApiCollect + func (c *ApiCollectCacheMap) Set(node string, collects []*models.ApiCollect) + func (c *ApiCollectCacheMap) SetAll(data map[string][]*models.ApiCollect) + type Cache struct + func NewCache(interval int) *Cache + func (p *Cache) Start() + func (p *Cache) Stop() + type CollectCacheMap struct + Data map[string]*models.Collect + var CollectCache *CollectCacheMap + func NewCollectCache() *CollectCacheMap + func (c *CollectCacheMap) GetBy(endpoint string) *models.Collect + func (c *CollectCacheMap) Set(endpoint string, collect *models.Collect) + func (c *CollectCacheMap) SetAll(strasMap map[string]*models.Collect) + type ConsistentHashRing struct + var JudgeHashRing *ConsistentHashRing + func NewConsistentHashRing(replicas int32, nodes []string) *ConsistentHashRing + func (this *ConsistentHashRing) GetNode(pk string) (string, error) + func (this *ConsistentHashRing) GetRing() *consistent.Consistent + func (this *ConsistentHashRing) Set(r *consistent.Consistent) + type IndexMap struct + Data map[int64]map[string]Series + var SeriesMap *IndexMap + func NewIndexMap() *IndexMap + func (i *IndexMap) Clean() + func (i *IndexMap) CleanLoop() + func (i *IndexMap) Get(id int64) []Series + func (i *IndexMap) Set(id int64, hash string, s Series) + type JudgeItemMap struct + M map[string]*SafeLinkedList + func NewJudgeItemMap() *JudgeItemMap + func (j *JudgeItemMap) BatchDelete(keys []string) + func (j *JudgeItemMap) CleanStale(before int64) + func (j *JudgeItemMap) Get(key string) (*SafeLinkedList, bool) + func (j *JudgeItemMap) Len() int + func (j *JudgeItemMap) Set(key string, val *SafeLinkedList) + type MaskCacheMap struct + Data map[string][]string + var MaskCache *MaskCacheMap + func NewMaskCache() *MaskCacheMap + func (this *MaskCacheMap) GetByKey(key string) ([]string, bool) + func (this *MaskCacheMap) SetAll(m map[string][]string) + type ModuleMetricMap struct + Data map[string]map[string]*dataobj.Metric + var ModuleMetric ModuleMetricMap + func (m *ModuleMetricMap) Get(module, metricName string) (*dataobj.Metric, bool) + func (m *ModuleMetricMap) GetByModule(module string) map[string]*dataobj.Metric + func (m *ModuleMetricMap) Set(module string, metrics map[string]*dataobj.Metric) + type NodeMap struct + func NewNodeMap() NodeMap + func (n *NodeMap) GetInstanceBy(node string) (string, bool) + func (n *NodeMap) GetNodeBy(instance string) (string, bool) + func (n *NodeMap) GetNodes() []string + func (n *NodeMap) Len() int + func (n *NodeMap) Set(nodeMap map[string]string) + type SafeAggrCalcMap struct + M map[string]map[string][]*dataobj.RawMetricAggrCalc + MetricMap map[int64]string + func (s *SafeAggrCalcMap) GetAll() []*dataobj.RawMetricAggrCalc + func (s *SafeAggrCalcMap) GetByKey(key string) []*dataobj.RawMetricAggrCalc + func (s *SafeAggrCalcMap) GetMetric(id int64) string + func (s *SafeAggrCalcMap) ReInit(m map[string]map[string][]*dataobj.RawMetricAggrCalc) + func (s *SafeAggrCalcMap) ReInitMetric(m map[int64]string) + type SafeEventMap struct + M map[string]*dataobj.Event + func (s *SafeEventMap) Get(key string) (*dataobj.Event, bool) + func (s *SafeEventMap) Set(key string, event *dataobj.Event) + type SafeJudgeQueue struct + Data map[string]*list.SafeListLimited + Ts map[string]int64 + func NewJudgeQueue() SafeJudgeQueue + func (s *SafeJudgeQueue) Clean() + func (s *SafeJudgeQueue) Del(instance string) + func (s *SafeJudgeQueue) Exists(instance string) bool + func (s *SafeJudgeQueue) Get(instance string) (*list.SafeListLimited, bool) + func (s *SafeJudgeQueue) GetAll() map[string]*list.SafeListLimited + func (s *SafeJudgeQueue) Set(instance string, q *list.SafeListLimited) + func (s *SafeJudgeQueue) UpdateTS(instance string) + type SafeLinkedList struct + L *list.List + func (ll *SafeLinkedList) Front() *list.Element + func (ll *SafeLinkedList) HistoryData() []*dataobj.HistoryData + func (ll *SafeLinkedList) Len() int + func (ll *SafeLinkedList) PushFrontAndMaintain(v *dataobj.JudgeItem, alertDur int) bool + func (ll *SafeLinkedList) QueryDataByTS(start, end int64) []*dataobj.HistoryData + type SafeStraMap struct + M map[string]map[string][]*models.Stra + func (s *SafeStraMap) GetAll() []*models.Stra + func (s *SafeStraMap) GetByKey(key string) []*models.Stra + func (s *SafeStraMap) ReInit(m map[string]map[string][]*models.Stra) + type Series struct + Dstype string + Endpoint string + Metric string + Nid string + Step int + TS int64 + Tag string + type SnmpCollectCacheMap struct + Data map[string][]*dataobj.IPAndSnmp + var SnmpCollectCache *SnmpCollectCacheMap + func NewSnmpCollectCache() *SnmpCollectCacheMap + func (c *SnmpCollectCacheMap) GetBy(node string) []*dataobj.IPAndSnmp + func (c *SnmpCollectCacheMap) Set(node string, collects []*dataobj.IPAndSnmp) + func (c *SnmpCollectCacheMap) SetAll(data map[string][]*dataobj.IPAndSnmp) + type SnmpHWCacheMap struct + Data map[string][]*models.NetworkHardware + var SnmpHWCache *SnmpHWCacheMap + func NewSnmpHWCache() *SnmpHWCacheMap + func (c *SnmpHWCacheMap) GetBy(node string) []*models.NetworkHardware + func (c *SnmpHWCacheMap) Set(node string, hws []*models.NetworkHardware) + func (c *SnmpHWCacheMap) SetAll(data map[string][]*models.NetworkHardware) + type StraCacheMap struct + Data map[string][]*models.Stra + var StraCache *StraCacheMap + func NewStraCache() *StraCacheMap + func (s *StraCacheMap) GetAll() []*models.Stra + func (s *StraCacheMap) GetByNode(node string) []*models.Stra + func (s *StraCacheMap) Set(node string, stras []*models.Stra) + func (s *StraCacheMap) SetAll(strasMap map[string][]*models.Stra) + type StrategyMap struct + Data map[int64]*models.Stra + TS map[int64]int64 + var NodataStra *StrategyMap + var Strategy *StrategyMap + func NewStrategyMap() *StrategyMap + func (s *StrategyMap) Clean() + func (s *StrategyMap) Get(id int64) (*models.Stra, bool) + func (s *StrategyMap) GetAll() []*models.Stra + func (s *StrategyMap) Set(id int64, stra *models.Stra)