Documentation ¶
Index ¶
- Variables
- func DeleteStaleAgents()
- func GetBuiltinMetrics(hostname string) ([]*model.NewBuiltinMetric, error)
- func GetPlugins(hostname string) []string
- func Init()
- func LoopInit()
- func ParentIds(allTpls map[int]*model.NewTemplate, tid int) (ret []int)
- type SafeAgents
- type SafeExpressionCache
- type SafeGitRepo
- type SafeGroupPlugins
- type SafeGroupTemplates
- type SafeHostGroupsMap
- type SafeHostMap
- type SafeHostTemplateIds
- type SafeMonitoredHosts
- type SafeStrategies
- type SafeTemplateCache
Constants ¶
This section is empty.
Variables ¶
View Source
var Agents = NewSafeAgents()
View Source
var ExpressionCache = &SafeExpressionCache{}
View Source
var GitRepo = &SafeGitRepo{gitRepo: ""}
View Source
var GroupPlugins = &SafeGroupPlugins{M: make(map[int][]string)}
View Source
var GroupTemplates = &SafeGroupTemplates{M: make(map[int][]int)}
View Source
var HostGroupsMap = &SafeHostGroupsMap{M: make(map[int][]int)}
View Source
var HostMap = &SafeHostMap{M: make(map[string]int)}
View Source
var HostTemplateIds = &SafeHostTemplateIds{M: make(map[int][]int)}
View Source
var MonitoredHosts = &SafeMonitoredHosts{M: make(map[int]*model.Host)}
View Source
var Strategies = &SafeStrategies{M: make(map[int]*model.NewStrategy)}
View Source
var TemplateCache = &SafeTemplateCache{M: make(map[int]*model.NewTemplate)}
Functions ¶
func DeleteStaleAgents ¶
func DeleteStaleAgents()
func GetBuiltinMetrics ¶
func GetBuiltinMetrics(hostname string) ([]*model.NewBuiltinMetric, error)
Types ¶
type SafeAgents ¶
type SafeAgents struct { sync.RWMutex M map[string]*model.AgentUpdateInfo }
func NewSafeAgents ¶
func NewSafeAgents() *SafeAgents
func (*SafeAgents) Delete ¶
func (this *SafeAgents) Delete(hostname string)
func (*SafeAgents) Get ¶
func (this *SafeAgents) Get(hostname string) (*model.AgentUpdateInfo, bool)
func (*SafeAgents) Keys ¶
func (this *SafeAgents) Keys() []string
func (*SafeAgents) Put ¶
func (this *SafeAgents) Put(req *model.AgentReportRequest, updateTime int64)
type SafeExpressionCache ¶
type SafeExpressionCache struct { sync.RWMutex L []*model.NewExpression }
func (*SafeExpressionCache) Get ¶
func (this *SafeExpressionCache) Get() []*model.NewExpression
func (*SafeExpressionCache) Init ¶
func (this *SafeExpressionCache) Init()
type SafeGitRepo ¶
func (*SafeGitRepo) Get ¶
func (this *SafeGitRepo) Get() string
func (*SafeGitRepo) Init ¶
func (this *SafeGitRepo) Init()
type SafeGroupPlugins ¶
一个HostGroup可以绑定多个Plugin
func (*SafeGroupPlugins) GetPlugins ¶
func (this *SafeGroupPlugins) GetPlugins(gid int) ([]string, bool)
func (*SafeGroupPlugins) Init ¶
func (this *SafeGroupPlugins) Init()
type SafeGroupTemplates ¶
一个HostGroup对应多个Template
func (*SafeGroupTemplates) GetTemplateIds ¶
func (this *SafeGroupTemplates) GetTemplateIds(gid int) ([]int, bool)
func (*SafeGroupTemplates) Init ¶
func (this *SafeGroupTemplates) Init()
type SafeHostGroupsMap ¶
一个机器可能在多个group下,做一个map缓存hostid与groupid的对应关系
func (*SafeHostGroupsMap) GetGroupIds ¶
func (this *SafeHostGroupsMap) GetGroupIds(hid int) ([]int, bool)
func (*SafeHostGroupsMap) Init ¶
func (this *SafeHostGroupsMap) Init()
type SafeHostMap ¶
每次心跳的时候agent把hostname汇报上来,经常要知道这个机器的hostid,把此信息缓存 key: hostname value: hostid
func (*SafeHostMap) Init ¶
func (this *SafeHostMap) Init()
type SafeHostTemplateIds ¶
func (*SafeHostTemplateIds) GetMap ¶
func (this *SafeHostTemplateIds) GetMap() map[int][]int
func (*SafeHostTemplateIds) Init ¶
func (this *SafeHostTemplateIds) Init()
type SafeMonitoredHosts ¶
func (*SafeMonitoredHosts) Init ¶
func (this *SafeMonitoredHosts) Init()
type SafeStrategies ¶
type SafeStrategies struct { sync.RWMutex M map[int]*model.NewStrategy }
func (*SafeStrategies) GetMap ¶
func (this *SafeStrategies) GetMap() map[int]*model.NewStrategy
func (*SafeStrategies) Init ¶
func (this *SafeStrategies) Init(tpls map[int]*model.NewTemplate)
type SafeTemplateCache ¶
type SafeTemplateCache struct { sync.RWMutex M map[int]*model.NewTemplate }
func (*SafeTemplateCache) GetMap ¶
func (this *SafeTemplateCache) GetMap() map[int]*model.NewTemplate
func (*SafeTemplateCache) Init ¶
func (this *SafeTemplateCache) Init()
Click to show internal directories.
Click to hide internal directories.