Documentation ¶
Index ¶
- func BuildHostInfoForRegisteredAgents() (map[string]*pbhost.HostInfo, error)
- func GetAgentInfo(hostname string) *mesos.AgentInfo
- func GetUpHostIP(hostname string) (string, error)
- func IsHostRegistered(hostname string) bool
- func IsRegisteredAsPelotonAgent(hostname, pelotonAgentRole string) bool
- type AgentMap
- type Loader
- type Metrics
- type ResourceCapacity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildHostInfoForRegisteredAgents ¶
BuildHostInfoForRegisteredAgents builds host infos for registered agents
func GetAgentInfo ¶
GetAgentInfo return agent info from global map.
func GetUpHostIP ¶
GetUpHostIP gets the IP address of a host in UP state
func IsHostRegistered ¶
IsHostRegistered returns whether the host is registered
func IsRegisteredAsPelotonAgent ¶
IsRegisteredAsPelotonAgent returns true if the host is registered as Peloton agent
Types ¶
type AgentMap ¶
type AgentMap struct { // Registered agent details by id. RegisteredAgents map[string]*mesos_master.Response_GetAgents_Agent // Resource capacity of all hosts. HostCapacities map[string]*ResourceCapacity Capacity scalar.Resources SlackCapacity scalar.Resources }
AgentMap is a placeholder from agent id to agent related information. Note that AgentInfo is immutable as of Mesos 1.3.
func GetAgentMap ¶
func GetAgentMap() *AgentMap
GetAgentMap returns a full map of all registered agents. Note that caller should not mutable the content since it's not protected by any lock.
func (*AgentMap) ReportCapacityMetrics ¶
ReportCapacityMetrics into given metric scope.
type Loader ¶
type Loader struct { sync.Mutex OperatorClient mpb.MasterOperatorClient SlackResourceTypes []string Scope tally.Scope HostInfoOps ormobjects.HostInfoOps // DB ops for host_info table }
Loader loads hostmap from Mesos and stores in global singleton.
type Metrics ¶
type Metrics struct { DrainingHosts tally.Gauge DownHosts tally.Gauge // contains filtered or unexported fields }
Metrics is placeholder for all metrics in hostmgr/host package.
func NewMetrics ¶
NewMetrics returns a new Metrics struct, with all metrics initialized and rooted at the given tally.Scope