Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type Cluster
- func (c *Cluster) GetFramework(framework string) map[string]*Framework
- func (c *Cluster) GetLeader() string
- func (c *Cluster) GetSlaveByHostName(hostName string) *Slave
- func (c *Cluster) GetSlaveById(slaveId string) *Slave
- func (c *Cluster) LoadSlaveStates(client MesosClient) error
- func (c *Cluster) LoadSlaveStats(client MesosClient) error
- type Config
- type Executor
- type Framework
- type MesosClient
- type Resource
- type Slave
- type SlaveStats
- type Status
- type Task
Constants ¶
View Source
const (
HTTP_GET = "GET"
)
Variables ¶
View Source
var ( ErrInvalidResponse = errors.New("Invalid response from Mesos") ErrDoesNotExist = errors.New("The resource does not exist") ErrInternalServerError = errors.New("Mesos returned an internal server error") ErrSlaveStateLoadError = errors.New("An error was encountered loading the state of one or more Mesos slaves") ErrClusterDiscoveryError = errors.New("An error was encountered while running Mesos cluster discovery") )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { LeaderPID string `json:"leader"` Version string `json:"version"` Frameworks []*Framework `json:"frameworks,omitempty"` Slaves []*Slave `json:"slaves"` }
func DiscoverCluster ¶
func DiscoverCluster(client MesosClient) (*Cluster, error)
func (*Cluster) GetFramework ¶
func (*Cluster) GetSlaveByHostName ¶
func (*Cluster) GetSlaveById ¶
func (*Cluster) LoadSlaveStates ¶
func (c *Cluster) LoadSlaveStates(client MesosClient) error
func (*Cluster) LoadSlaveStats ¶
func (c *Cluster) LoadSlaveStats(client MesosClient) error
type Config ¶
type Config struct { DiscoveryURL string MasterURL string MasterPort int SlavePort int LogOutput io.Writer RequestTimeout int }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type Executor ¶
type Executor struct { Id string `json:"id"` Name string `json:"name"` SlaveId string `json:"slave_id"` State string `json:"state"` Container string `json:"container"` Resources *Resource `json:"resources"` Tasks []*Task `json:"tasks"` }
func (*Executor) RegisteredContainerName ¶
type Framework ¶
type Framework struct { Id string `json:"id"` Name string `json:"name"` Active bool `json:"active"` HostName string `json:"hostname"` Resources *Resource `json:"resources"` OfferedResources *Resource `json:"offered_resources"` UsedResources *Resource `json:"used_resources"` Tasks []*Task `json:"tasks"` CompletedTasks []*Task `json:"completed_tasks"` Executors []*Executor `json:"executors"` }
type MesosClient ¶
type MesosClient interface {
// contains filtered or unexported methods
}
type Slave ¶
type Slave struct { Id string `json:"id"` HostName string `json:"hostname"` Attributes map[string]string `json:"attributes"` Resources Resource `json:"resources"` Frameworks []*Framework `json:"frameworks"` StateLoadError bool Stats *SlaveStats StateLastUpdated time.Time StatsLastUpdated time.Time }
func (*Slave) LoadState ¶
func (s *Slave) LoadState(client MesosClient) error
func (*Slave) LoadStats ¶
func (s *Slave) LoadStats(client MesosClient) error
type SlaveStats ¶
type SlaveStats struct { ContainerDestroyErrors float64 `json:"containerizer/mesos/container_destroy_errors"` ContainerLaunchErrors float64 `json:"slave/container_launch_errors"` CpusPercent float64 `json:"slave/cpus_percent"` CpusRevocablePercent float64 `json:"slave/cpus_revocable_percent"` CpusRevocableTotal float64 `json:"slave/cpus_revocable_total"` CpusRevocableUsed float64 `json:"slave/cpus_revocable_used"` CpusTotal float64 `json:"slave/cpus_total"` CpusUsed float64 `json:"slave/cpus_used"` DiskPercent float64 `json:"slave/disk_percent"` DiskRevocablePercent float64 `json:"slave/disk_revocable_percent"` DiskRevocableTotal float64 `json:"slave/disk_revocable_total"` DiskRevocableUsed float64 `json:"slave/disk_revocable_used"` DiskTotal float64 `json:"slave/disk_total"` DiskUsed float64 `json:"slave/disk_used"` ExecDirMaxAge float64 `json:"slave/executor_directory_max_allowed_age_secs"` ExecutorsPreempted float64 `json:"slave/executors_preempted"` ExecutorsRegistering float64 `json:"slave/executors_registering"` ExecutorsRunning float64 `json:"slave/executors_running"` ExecutorsTerminated float64 `json:"slave/executors_terminated"` ExecutorsTerminating float64 `json:"slave/executors_terminating"` FrameworksActive float64 `json:"slave/frameworks_active"` InvalidFrameworkMessages float64 `json:"slave/invalid_framework_messages"` InvalidStatusUpdates float64 `json:"slave/invalid_status_updates"` MemPercent float64 `json:"slave/mem_percent"` MemRevocablePercent float64 `json:"slave/mem_revocable_percent"` MemRevocableTotal float64 `json:"slave/mem_revocable_total"` MemRevocableUsed float64 `json:"slave/mem_revocable_used"` MemTotal float64 `json:"slave/mem_total"` MemUsed float64 `json:"slave/mem_used"` RecoveryErrors float64 `json:"slave/recovery_errors"` Registered float64 `json:"slave/registered"` TasksFailed float64 `json:"slave/tasks_failed"` TasksFinished float64 `json:"slave/tasks_finished"` TasksKilled float64 `json:"slave/tasks_killed"` TasksLost float64 `json:"slave/tasks_lost"` TasksRunning float64 `json:"slave/tasks_running"` TasksStaging float64 `json:"slave/tasks_staging"` TasksStarting float64 `json:"slave/tasks_starting"` UptimeSecs float64 `json:"slave/uptime_secs"` ValidFrameworkMessages float64 `json:"slave/valid_framework_messages"` ValidStatusUpdates float64 `json:"slave/valid_status_updates"` Load1Min float64 `json:"system/load_1min"` Load5Min float64 `json:"system/load_5min"` Load15Min float64 `json:"system/load_15min"` MemFreeBytes float64 `json:"system/mem_free_bytes"` MemTotalBytes float64 `json:"system/mem_total_bytes"` }
Click to show internal directories.
Click to hide internal directories.