Documentation ¶
Index ¶
- Variables
- func DeleteStaleAgents()
- func GetBuiltinMetrics(hostname string) ([]*model.BuiltinMetric, error)
- func GetPlugins(hostname string) []string
- func Init()
- func LoopInit()
- func ParentIds(allTpls map[int]*model.Template, tid int) (ret []int)
- type SafeAgents
- type SafeExpressionCache
- 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 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.Strategy)}
View Source
var TemplateCache = &SafeTemplateCache{M: make(map[int]*model.Template)}
Functions ¶
func DeleteStaleAgents ¶
func DeleteStaleAgents()
func GetBuiltinMetrics ¶
func GetBuiltinMetrics(hostname string) ([]*model.BuiltinMetric, 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)
type SafeExpressionCache ¶
type SafeExpressionCache struct { sync.RWMutex L []*model.Expression }
func (*SafeExpressionCache) Get ¶
func (this *SafeExpressionCache) Get() []*model.Expression
func (*SafeExpressionCache) Init ¶
func (this *SafeExpressionCache) 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 ¶
Click to show internal directories.
Click to hide internal directories.