Documentation
¶
Overview ¶
Package megos provides a client library for accessing information of a Apache Mesos cluster.
Construct a new megos client, then use the various functions on the client to access different information of Mesos HTTP endpoints. For example to identify the leader node:
node1, _ := url.Parse("http://192.168.1.120:5050/")
node2, _ := url.Parse("http://192.168.1.122:5050/")
mesos := megos.NewClient([]*url.URL{node1, node2}, nil)
leader, err := mesos.DetermineLeader()
if err != nil {
panic(err)
}
fmt.Println(leader)
// Output:
// master@192.168.1.122:5050
More examples are available in the README.md on github: https://github.com/andygrunwald/megos
Index ¶
- func AppendPath(instance url.URL, path string) url.URL
- type Address
- type Client
- func (c *Client) DetermineLeader() (*Pid, error)
- func (c *Client) GetBodyOfHTTPResponse(u *url.URL) ([]byte, error)
- func (c *Client) GetExecutorByID(executor []Executor, executorID string) (*Executor, error)
- func (c *Client) GetFrameworkByPrefix(frameworks []Framework, prefix string) (*Framework, error)
- func (c *Client) GetHTTPResponse(u *url.URL) (*http.Response, error)
- func (c *Client) GetHTTPResponseFromCluster(f func(url.URL) url.URL) (*http.Response, error)
- func (c *Client) GetHTTPResponseFromLeader(f func(Pid) url.URL) (*http.Response, error)
- func (c *Client) GetMetricsSnapshot(pid *Pid) (*MetricsSnapshot, error)
- func (c *Client) GetSlaveByID(slaves []Slave, slaveID string) (*Slave, error)
- func (c *Client) GetSlavesFromCluster() (*State, error)
- func (c *Client) GetSlavesFromLeader() (*State, error)
- func (c *Client) GetSlavesFromPid(pid *Pid) (*State, error)
- func (c *Client) GetStateFromCluster() (*State, error)
- func (c *Client) GetStateFromLeader() (*State, error)
- func (c *Client) GetStateFromPid(pid *Pid) (*State, error)
- func (c *Client) GetStateSummaryFromCluster() (*State, error)
- func (c *Client) GetStateSummaryFromLeader() (*State, error)
- func (c *Client) GetStateSummaryFromPid(pid *Pid) (*State, error)
- func (c *Client) GetStdErrOfTask(pid *Pid, directory string) ([]byte, error)
- func (c *Client) GetStdOutOfTask(pid *Pid, directory string) ([]byte, error)
- func (c *Client) GetSystemFromPid(pid *Pid) (*System, error)
- func (c *Client) GetTaskByID(tasks []Task, taskID string) (*Task, error)
- func (c *Client) GetURLForMetricsSnapshotPid(pid Pid) url.URL
- func (c *Client) GetURLForSlavesFile(instance url.URL) url.URL
- func (c *Client) GetURLForSlavesFilePid(pid Pid) url.URL
- func (c *Client) GetURLForStateFile(instance url.URL) url.URL
- func (c *Client) GetURLForStateFilePid(pid Pid) url.URL
- func (c *Client) GetURLForStateSummaryFile(instance url.URL) url.URL
- func (c *Client) GetURLForStateSummaryFilePid(pid Pid) url.URL
- func (c *Client) GetURLForSystemFilePid(pid Pid) url.URL
- func (c *Client) ParsePidInformation(pid string) (*Pid, error)
- type Container
- type ContainerStatus
- type Docker
- type Executor
- type Flags
- type Framework
- type HTTPClient
- type IpAddress
- type Label
- type MetricsSnapshot
- type NetworkInfo
- type Offer
- type Parameter
- type Pid
- type PortDetails
- type PortMapping
- type Ports
- type Resources
- type Slave
- type State
- type System
- type Task
- type TaskDiscovery
- type TaskStatus
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
Hostname string `json:"hostname"`
IP string `json:"ip"`
Port int `json:"port"`
}
Address represents a single address. e.g. from a Slave or from a Master
type Client ¶
type Client struct {
sync.Mutex
// Master is the list of Mesos master nodes in the cluster.
Master []*url.URL
// Leader is the PID reference to the Leader of the Cluster (of Master URLs)
Leader *Pid
State *State
System *System
MetricsSnapshot *MetricsSnapshot
HTTP HTTPClient
}
Client manages the communication with the Mesos cluster.
func NewClient ¶
func NewClient(addresses []*url.URL, httpClient HTTPClient) *Client
NewClient returns a new Megos / Mesos information client. addresses has to be the the URL`s of the single nodes of the Mesos cluster. It is recommended to apply all nodes in case of failures.
func (*Client) DetermineLeader ¶
DetermineLeader will return the leader of several master nodes of the Mesos cluster. Only one leader is chosen per time. This leader will be returned.
func (*Client) GetBodyOfHTTPResponse ¶
GetBodyOfHTTPResponse will return the request body of the requested url u.
func (*Client) GetExecutorByID ¶
GetExecutorByID will return an Executor by its unique ID.
The list of executors are provided by a framework.
func (*Client) GetFrameworkByPrefix ¶
GetFrameworkByPrefix will return a framework that matches prefix.
The list of framework are provided by a state of a slave / master.
func (*Client) GetHTTPResponse ¶
GetHTTPResponse will return a http.Response from a URL
func (*Client) GetHTTPResponseFromCluster ¶
GetHTTPResponseFromCluster will return a http.Response from one of the Mesos master nodes. In a cluster the master nodes can be online or offline. With GetHTTPResponseFromCluster you will receive a response from one of the nodes.
func (*Client) GetHTTPResponseFromLeader ¶
GetHTTPResponseFromLeader will return a http.Response from the determined leader of the master nodes.
func (*Client) GetMetricsSnapshot ¶
func (c *Client) GetMetricsSnapshot(pid *Pid) (*MetricsSnapshot, error)
GetMetricsSnapshot will return the snapshot of pid
func (*Client) GetSlaveByID ¶
GetSlaveByID will return a a slave by its unique ID (slaveID).
The list of slaves are provided by a state of a single node.
func (*Client) GetSlavesFromCluster ¶
GetSlavesFromCluster will return the current slaves of one of the cluster nodes.
func (*Client) GetSlavesFromLeader ¶
GetSlavesFromLeader will return the current slaves of the leader node of the cluster.
func (*Client) GetSlavesFromPid ¶
GetSlavesFromPid will return the current slaves of the process id per machine (PID).
func (*Client) GetStateFromCluster ¶
GetStateFromCluster will return the current state of one of the cluster nodes.
func (*Client) GetStateFromLeader ¶
GetStateFromLeader will return the current state of the leader node of the cluster.
func (*Client) GetStateFromPid ¶
GetStateFromPid will return the current state of the process id per machine (PID).
func (*Client) GetStateSummaryFromCluster ¶
GetStateSummaryFromCluster will return the current state summary of one of the cluster nodes.
func (*Client) GetStateSummaryFromLeader ¶
GetStateSummaryFromLeader will return the current state summary of the leader node of the cluster.
func (*Client) GetStateSummaryFromPid ¶
GetStateSummaryFromPid will return the current state summary of the process id per machine (PID).
func (*Client) GetStdErrOfTask ¶
GetStdErrOfTask will return Stdout of a task.
pid is a single mesos slave node. directory is the directory of a single executor,
func (*Client) GetStdOutOfTask ¶
GetStdOutOfTask will return Stdout of a task.
pid is a single mesos slave node. directory is the directory of a single executor,
func (*Client) GetSystemFromPid ¶
GetSystemFromPid will return the system stats of node
func (*Client) GetTaskByID ¶
GetTaskByID will return a Task by its unique ID.
The list of tasks are provided by a framework.
func (*Client) GetURLForMetricsSnapshotPid ¶
GetURLForMetricsSnapshotPid will return the URL for the snapshot based on a PID
func (*Client) GetURLForSlavesFile ¶
GetURLForSlavesFile will return the URL for the slaves file of a node
func (*Client) GetURLForSlavesFilePid ¶
GetURLForSlavesFilePid will return the URL for the slaves file of a node based on a PID
func (*Client) GetURLForStateFile ¶
GetURLForStateFile will return the URL for the state file of a node
func (*Client) GetURLForStateFilePid ¶
GetURLForStateFilePid will return the URL for the state file of a node based on a PID
func (*Client) GetURLForStateSummaryFile ¶
GetURLForStateSummaryFile will return the URL for the state-summary file of a node
func (*Client) GetURLForStateSummaryFilePid ¶
GetURLForStateSummaryFilePid will return the URL for the state-summary file of a node based on a PID
func (*Client) GetURLForSystemFilePid ¶
GetURLForSystemFilePid will return the URL for the system stats of a node based on a PID
type ContainerStatus ¶
type ContainerStatus struct {
NetworkInfos []NetworkInfo `json:"network_infos"`
}
ContainerStatus represents the status of a single container inside a task
type Docker ¶
type Docker struct {
Image string `json:"image"`
Network string `json:"network"`
PortMappings []PortMapping `json:"port_mappings"`
Priviledge bool `json:"priviledge"`
Parameters []Parameter `json:"parameters"`
ForcePullImage bool `json:"force_pull_image"`
}
Docker is one type of Container
type Executor ¶
type Executor struct {
CompletedTasks []Task `json:"completed_tasks"`
Container string `json:"container"`
Directory string `json:"directory"`
ID string `json:"id"`
Name string `json:"name"`
Resources Resources `json:"resources"`
Source string `json:"source"`
QueuedTasks []Task `json:"queued_tasks"`
Tasks []Task `json:"tasks"`
}
Executor represents a single executor of a framework
type Flags ¶
type Flags struct {
AppcStoreDir string `json:"appc_store_dir"`
AllocationInterval string `json:"allocation_interval"`
Allocator string `json:"allocator"`
Authenticate string `json:"authenticate"`
AuthenticateHTTP string `json:"authenticate_http"`
Authenticatee string `json:"authenticatee"`
AuthenticateSlaves string `json:"authenticate_slaves"`
Authenticators string `json:"authenticators"`
Authorizers string `json:"authorizers"`
CgroupsCPUEnablePIDsAndTIDsCount string `json:"cgroups_cpu_enable_pids_and_tids_count"`
CgroupsEnableCfs string `json:"cgroups_enable_cfs"`
CgroupsHierarchy string `json:"cgroups_hierarchy"`
CgroupsLimitSwap string `json:"cgroups_limit_swap"`
CgroupsRoot string `json:"cgroups_root"`
Cluster string `json:"cluster"`
ContainerDiskWatchInterval string `json:"container_disk_watch_interval"`
Containerizers string `json:"containerizers"`
DefaultRole string `json:"default_role"`
DiskWatchInterval string `json:"disk_watch_interval"`
Docker string `json:"docker"`
DockerKillOrphans string `json:"docker_kill_orphans"`
DockerRegistry string `json:"docker_registry"`
DockerRemoveDelay string `json:"docker_remove_delay"`
DockerSandboxDirectory string `json:"docker_sandbox_directory"`
DockerSocket string `json:"docker_socket"`
DockerStoreDir string `json:"docker_store_dir"`
DockerStopTimeout string `json:"docker_stop_timeout"`
EnforceContainerDiskQuota string `json:"enforce_container_disk_quota"`
ExecutorRegistrationTimeout string `json:"executor_registration_timeout"`
ExecutorShutdownGracePeriod string `json:"executor_shutdown_grace_period"`
FetcherCacheDir string `json:"fetcher_cache_dir"`
FetcherCacheSize string `json:"fetcher_cache_size"`
FrameworksHome string `json:"frameworks_home"`
FrameworkSorter string `json:"framework_sorter"`
GCDelay string `json:"gc_delay"`
GCDiskHeadroom string `json:"gc_disk_headroom"`
HadoopHome string `json:"hadoop_home"`
Help string `json:"help"`
Hostname string `json:"hostname"`
HostnameLookup string `json:"hostname_lookup"`
HTTPAuthenticators string `json:"http_authenticators"`
ImageProvisionerBackend string `json:"image_provisioner_backend"`
InitializeDriverLogging string `json:"initialize_driver_logging"`
IP string `json:"ip"`
Isolation string `json:"isolation"`
LauncherDir string `json:"launcher_dir"`
LogAutoInitialize string `json:"log_auto_initialize"`
LogDir string `json:"log_dir"`
Logbufsecs string `json:"logbufsecs"`
LoggingLevel string `json:"logging_level"`
MaxCompletedFrameworks string `json:"max_completed_frameworks"`
MaxCompletedTasksPerFramework string `json:"max_completed_tasks_per_framework"`
MaxSlavePingTimeouts string `json:"max_slave_ping_timeouts"`
Master string `json:"master"`
PerfDuration string `json:"perf_duration"`
PerfInterval string `json:"perf_interval"`
Port string `json:"port"`
Quiet string `json:"quiet"`
Quorum string `json:"quorum"`
QOSCorrectionIntervalMin string `json:"qos_correction_interval_min"`
Recover string `json:"recover"`
RevocableCPULowPriority string `json:"revocable_cpu_low_priority"`
RecoverySlaveRemovalLimit string `json:"recovery_slave_removal_limit"`
RecoveryTimeout string `json:"recovery_timeout"`
RegistrationBackoffFactor string `json:"registration_backoff_factor"`
Registry string `json:"registry"`
RegistryFetchTimeout string `json:"registry_fetch_timeout"`
RegistryStoreTimeout string `json:"registry_store_timeout"`
RegistryStrict string `json:"registry_strict"`
ResourceMonitoringInterval string `json:"resource_monitoring_interval"`
RootSubmissions string `json:"root_submissions"`
SandboxDirectory string `json:"sandbox_directory"`
SlavePingTimeout string `json:"slave_ping_timeout"`
SlaveReregisterTimeout string `json:"slave_reregister_timeout"`
Strict string `json:"strict"`
SystemdRuntimeDirectory string `json:"systemd_runtime_directory"`
SwitchUser string `json:"switch_user"`
OversubscribedResourcesInterval string `json:"oversubscribed_resources_interval"`
UserSorter string `json:"user_sorter"`
Version string `json:"version"`
WebuiDir string `json:"webui_dir"`
WorkDir string `json:"work_dir"`
ZK string `json:"zk"`
ZKSessionTimeout string `json:"zk_session_timeout"`
}
Flags represents the flags of a mesos state
type Framework ¶
type Framework struct {
Active bool `json:"active"`
Checkpoint bool `json:"checkpoint"`
CompletedTasks []Task `json:"completed_tasks"`
Executors []Executor `json:"executors"`
CompletedExecutors []Executor `json:"completed_executors"`
FailoverTimeout float64 `json:"failover_timeout"`
Hostname string `json:"hostname"`
ID string `json:"id"`
Name string `json:"name"`
PID string `json:"pid"`
OfferedResources Resources `json:"offered_resources"`
Offers []Offer `json:"offers"`
RegisteredTime float64 `json:"registered_time"`
ReregisteredTime float64 `json:"reregistered_time"`
Resources Resources `json:"resources"`
Role string `json:"role"`
Tasks []Task `json:"tasks"`
UnregisteredTime float64 `json:"unregistered_time"`
UsedResources Resources `json:"used_resources"`
User string `json:"user"`
WebuiURL string `json:"webui_url"`
Labels []Label `json:"label"`
}
Framework represent a single framework of a mesos node
type HTTPClient ¶
HTTPClient allows the client to be changed to any valid client.
type IpAddress ¶
type IpAddress struct {
IpAddress string `json:"ip_address"`
}
IpAddress represents a single IpAddress
type MetricsSnapshot ¶
type MetricsSnapshot struct {
AllocatorEventQueueDispatches float64 `json:"allocator/event_queue_dispatches"`
AllocatorMesosAllocationRunMs float64 `json:"allocator/mesos/allocation_run_ms"`
AllocatorMesosAllocationRunMsCount float64 `json:"allocator/mesos/allocation_run_ms/count"`
AllocatorMesosAllocationRunMsMax float64 `json:"allocator/mesos/allocation_run_ms/max"`
AllocatorMesosAllocationRunMsMin float64 `json:"allocator/mesos/allocation_run_ms/min"`
AllocatorMesosAllocationRunMsP50 float64 `json:"allocator/mesos/allocation_run_ms/p50"`
AllocatorMesosAllocationRunMsP90 float64 `json:"allocator/mesos/allocation_run_ms/p90"`
AllocatorMesosAllocationRunMsP95 float64 `json:"allocator/mesos/allocation_run_ms/p95"`
AllocatorMesosAllocationRunMsP99 float64 `json:"allocator/mesos/allocation_run_ms/p99"`
AllocatorMesosAllocationRunMsP999 float64 `json:"allocator/mesos/allocation_run_ms/p999"`
AllocatorMesosAllocationRunMsP9999 float64 `json:"allocator/mesos/allocation_run_ms/p9999"`
AllocatorMesosAllocationRuns float64 `json:"allocator/mesos/allocation_runs"`
AllocatorMesosEventQueueDispatches float64 `json:"allocator/mesos/event_queue_dispatches"`
AllocatorMesosOfferFiltersRolesActive float64 `json:"allocator/mesos/offer_filters/roles/*/active"`
AllocatorMesosResourcesCpusOfferedorAllocated float64 `json:"allocator/mesos/resources/cpus/offered_or_allocated"`
AllocatorMesosResourcesCpusTotal float64 `json:"allocator/mesos/resources/cpus/total"`
AllocatorMesosResourcesDiskOfferedorAllocated float64 `json:"allocator/mesos/resources/disk/offered_or_allocated"`
AllocatorMesosResourcesDiskTotal float64 `json:"allocator/mesos/resources/disk/total"`
AllocatorMesosResourcesMemOfferedorAllocated float64 `json:"allocator/mesos/resources/mem/offered_or_allocated"`
AllocatorMesosResourcesMemTotal float64 `json:"allocator/mesos/resources/mem/total"`
MasterCpusPercent float64 `json:"master/cpus_percent"`
MasterCpusRevocablePercent float64 `json:"master/cpus_revocable_percent"`
MasterCpusRevocableTotal float64 `json:"master/cpus_revocable_total"`
MasterCpusRevocableUsed float64 `json:"master/cpus_revocable_used"`
MasterCpusTotal float64 `json:"master/cpus_total"`
MasterCpusUsed float64 `json:"master/cpus_used"`
MasterDiskPercent float64 `json:"master/disk_percent"`
MasterDiskRevocablePercent float64 `json:"master/disk_revocable_percent"`
MasterDiskRevocableTotal float64 `json:"master/disk_revocable_total"`
MasterDiskRevocableUsed float64 `json:"master/disk_revocable_used"`
MasterDiskTotal float64 `json:"master/disk_total"`
MasterDiskUsed float64 `json:"master/disk_used"`
MasterDroppedMessages float64 `json:"master/dropped_messages"`
MasterElected float64 `json:"master/elected"`
MasterEventQueueDispatches float64 `json:"master/event_queue_dispatches"`
MasterEventQueueHttpRequests float64 `json:"master/event_queue_http_requests"`
MasterEventQueueMessages float64 `json:"master/event_queue_messages"`
MasterFrameworksActive float64 `json:"master/frameworks_active"`
MasterFrameworksConnected float64 `json:"master/frameworks_connected"`
MasterFrameworksDisconnected float64 `json:"master/frameworks_disconnected"`
MasterFrameworksInactive float64 `json:"master/frameworks_inactive"`
MasterGpusPercent float64 `json:"master/gpus_percent"`
MasterGpusRevocablePercent float64 `json:"master/gpus_revocable_percent"`
MasterGpusRevocableTotal float64 `json:"master/gpus_revocable_total"`
MasterGpusRevocableUsed float64 `json:"master/gpus_revocable_used"`
MasterGpusTotal float64 `json:"master/gpus_total"`
MasterGpusUsed float64 `json:"master/gpus_used"`
MasterInvalidExecutortoFrameworkMessages float64 `json:"master/invalid_executor_to_framework_messages"`
MasterInvalidFrameworktoExecutorMessages float64 `json:"master/invalid_framework_to_executor_messages"`
MasterInvalidStatusUpdateAcknowledgements float64 `json:"master/invalid_status_update_acknowledgements"`
MasterInvalidStatusUpdates float64 `json:"master/invalid_status_updates"`
MasterMemPercent float64 `json:"master/mem_percent"`
MasterMemRevocablePercent float64 `json:"master/mem_revocable_percent"`
MasterMemRevocableTotal float64 `json:"master/mem_revocable_total"`
MasterMemRevocableUsed float64 `json:"master/mem_revocable_used"`
MasterMemTotal float64 `json:"master/mem_total"`
MasterMemUsed float64 `json:"master/mem_used"`
MasterMessagesAuthenticate float64 `json:"master/messages_authenticate"`
MasterMessagesDeactivateFramework float64 `json:"master/messages_deactivate_framework"`
MasterMessagesDeclineOffers float64 `json:"master/messages_decline_offers"`
MasterMessagesExecutortoFramework float64 `json:"master/messages_executor_to_framework"`
MasterMessagesExitedExecutor float64 `json:"master/messages_exited_executor"`
MasterMessagesFrameworkToExecutor float64 `json:"master/messages_framework_to_executor"`
MasterMessagesKillTask float64 `json:"master/messages_kill_task"`
MasterMessagesLaunchTasks float64 `json:"master/messages_launch_tasks"`
MasterMessagesReconcileTasks float64 `json:"master/messages_reconcile_tasks"`
MasterMessagesRegisterFramework float64 `json:"master/messages_register_framework"`
MasterMessagesRegisterSlave float64 `json:"master/messages_register_slave"`
MasterMessagesReregisterFramework float64 `json:"master/messages_reregister_framework"`
MasterMessagesReregisterSlave float64 `json:"master/messages_reregister_slave"`
MasterMessagesResourceRequest float64 `json:"master/messages_resource_request"`
MasterMessagesReviveOffers float64 `json:"master/messages_revive_offers"`
MasterMessagesStatusUpdate float64 `json:"master/messages_status_update"`
MasterMessagesStatusUpdateAcknowledgement float64 `json:"master/messages_status_update_acknowledgement"`
MasterMessagesSuppressOffers float64 `json:"master/messages_suppress_offers"`
MasterMessagesUnregisterFramework float64 `json:"master/messages_unregister_framework"`
MasterMessagesUnregisterSlave float64 `json:"master/messages_unregister_slave"`
MasterMessagesUpdateSlave float64 `json:"master/messages_update_slave"`
MasterOutstandingOffers float64 `json:"master/outstanding_offers"`
MasterRecoverySlaveRemovals float64 `json:"master/recovery_slave_removals"`
MasterSlaveRegistrations float64 `json:"master/slave_registrations"`
MasterSlaveRemovals float64 `json:"master/slave_removals"`
MasterSlaveRemovalsReasonRegistered float64 `json:"master/slave_removals/reason_registered"`
MasterSlaveRemovalsReasonUnhealthy float64 `json:"master/slave_removals/reason_unhealthy"`
MasterSlaveRemovalsReasonUnregistered float64 `json:"master/slave_removals/reason_unregistered"`
MasterSlaveReregistrations float64 `json:"master/slave_reregistrations"`
MasterSlaveShutdownsCanceled float64 `json:"master/slave_shutdowns_canceled"`
MasterSlaveShutdownsCompleted float64 `json:"master/slave_shutdowns_completed"`
MasterSlaveShutdownsScheduled float64 `json:"master/slave_shutdowns_scheduled"`
MasterSlavesActive float64 `json:"master/slaves_active"`
MasterSlavesConnected float64 `json:"master/slaves_connected"`
MasterSlavesDisconnected float64 `json:"master/slaves_disconnected"`
MasterSlavesInactive float64 `json:"master/slaves_inactive"`
MasterTaskFailedSourceSlaveReasonContainerLaunchFailed float64 `json:"master/task_failed/source_slave/reason_container_launch_failed"`
MasterTaskKilledSourceSlaveReasonExecutorUnregistered float64 `json:"master/task_killed/source_slave/reason_executor_unregistered"`
MasterTasksError float64 `json:"master/tasks_error"`
MasterTasksFailed float64 `json:"master/tasks_failed"`
MasterTasksFinished float64 `json:"master/tasks_finished"`
MasterTasksKilled float64 `json:"master/tasks_killed"`
MasterTasksKilling float64 `json:"master/tasks_killing"`
MasterTasksLost float64 `json:"master/tasks_lost"`
MasterTasksRunning float64 `json:"master/tasks_running"`
MasterTasksStaging float64 `json:"master/tasks_staging"`
MasterTasksStarting float64 `json:"master/tasks_starting"`
MasterUptimeSecs float64 `json:"master/uptime_secs"`
MasterValidExecutortoFrameworkMessages float64 `json:"master/valid_executor_to_framework_messages"`
MasterValidFrameworktoExecutorMessages float64 `json:"master/valid_framework_to_executor_messages"`
MasterValidStatusUpdateAcknowledgements float64 `json:"master/valid_status_update_acknowledgements"`
MasterValidStatusUpdates float64 `json:"master/valid_status_updates"`
RegistrarLogRecovered float64 `json:"registrar/log/recovered"`
RegistrarQueuedOperations float64 `json:"registrar/queued_operations"`
RegistrarRegistrySizeBytes float64 `json:"registrar/registry_size_bytes"`
RegistrarStateFetchMs float64 `json:"registrar/state_fetch_ms"`
RegistrarStateStoreMs float64 `json:"registrar/state_store_ms"`
RegistrarStateStoreMsCount float64 `json:"registrar/state_store_ms/count"`
RegistrarStateStoreMsMax float64 `json:"registrar/state_store_ms/max"`
RegistrarStateStoreMsMin float64 `json:"registrar/state_store_ms/min"`
RegistrarStateStoreMsP50 float64 `json:"registrar/state_store_ms/p50"`
RegistrarStateStoreMsP90 float64 `json:"registrar/state_store_ms/p90"`
RegistrarStateStoreMsP95 float64 `json:"registrar/state_store_ms/p95"`
RegistrarStateStoreMsP99 float64 `json:"registrar/state_store_ms/p99"`
RegistrarStateStoreMsP999 float64 `json:"registrar/state_store_ms/p999"`
RegistrarStateStoreMsP9999 float64 `json:"registrar/state_store_ms/p9999"`
SystemCpusTotal float64 `json:"system/cpus_total"`
SystemLoad15min float64 `json:"system/load_15min"`
SystemLoad1min float64 `json:"system/load_1min"`
SystemLoad5min float64 `json:"system/load_5min"`
SystemMemFreeBytes float64 `json:"system/mem_free_bytes"`
SystemMemTotalBytes float64 `json:"system/mem_total_bytes"`
}
MetricsSnapshot represents the metrics of a node
type NetworkInfo ¶
type NetworkInfo struct {
IpAddress string `json:"ip_address"`
IpAddresses []IpAddress `json:"ip_addresses"`
}
NetworkInfo represents information about the network of a container
type Offer ¶
type Offer struct {
ID string `json:"id"`
FrameworkID string `json:"framework_id"`
SlaveID string `json:"slave_id"`
Hostname string `json:"hostname"`
URL URL `json:"url"`
Resources Resources `json:"resources"`
Attributes map[string]string `json:"attributes"`
}
Offer represents a single offer from a Mesos Slave to a Mesos master
type Pid ¶
type Pid struct {
// Role of a PID
Role string
// Host / IP of the PID
Host string
// Port of the PID.
// If no Port is available the standard port (5050) will be used.
Port int
}
Pid is the process if per machine.
type PortDetails ¶
PortDetails represents details about a single port
type PortMapping ¶
type PortMapping struct {
HostPort int `json:"host_port"`
ContainerPort int `json:"container_port"`
Protocol string `json:"protocol"`
}
PortMapping represents how containers ports map to host ports
type Ports ¶
type Ports struct {
Ports []PortDetails `json:"ports"`
}
Ports represents a number of PortDetails
type Resources ¶
type Resources struct {
CPUs float64 `json:"cpus"`
Disk float64 `json:"disk"`
Mem float64 `json:"mem"`
Ports string `json:"ports"`
}
Resources represents a resource type for a task
type Slave ¶
type Slave struct {
Active bool `json:"active"`
Hostname string `json:"hostname"`
ID string `json:"id"`
PID string `json:"pid"`
RegisteredTime float64 `json:"registered_time"`
Resources Resources `json:"resources"`
UsedResources Resources `json:"used_resources"`
OfferedResources Resources `json:"offered_resources"`
ReservedResources map[string]Resources `json:"reserved_resources"`
UnreservedResources Resources `json:"unreserved_resources"`
Attributes map[string]interface{} `json:"attributes"`
Version string `json:"version"`
}
Slave represents a single mesos slave node
type State ¶
type State struct {
Version string `json:"version"`
GitSHA string `json:"git_sha"`
GitTag string `json:"git_tag"`
BuildDate string `json:"build_date"`
BuildTime float64 `json:"build_time"`
BuildUser string `json:"build_user"`
StartTime float64 `json:"start_time"`
ElectedTime float64 `json:"elected_time"`
ID string `json:"id"`
PID string `json:"pid"`
Hostname string `json:"hostname"`
ActivatedSlaves float64 `json:"activated_slaves"`
DeactivatedSlaves float64 `json:"deactivated_slaves"`
Cluster string `json:"cluster"`
Leader string `json:"leader"`
CompletedFrameworks []Framework `json:"completed_frameworks"`
OrphanTasks []Task `json:"orphan_tasks"`
UnregisteredFrameworks []string `json:"unregistered_frameworks"`
Flags Flags `json:"flags"`
Slaves []Slave `json:"slaves"`
Frameworks []Framework `json:"frameworks"`
GitBranch string `json:"git_branch"`
LogDir string `json:"log_dir"`
ExternalLogFile string `json:"external_log_file"`
}
State represents the JSON from the state.json of a mesos node
type System ¶
type System struct {
AvgLoad15min float64 `json:"avg_load_15min"`
AvgLoad1min float64 `json:"avg_load_1min"`
AvgLoad5min float64 `json:"avg_load_5min"`
CpusTotal float64 `json:"cpus_total"`
MemFreeBytes float64 `json:"mem_free_bytes"`
MemTotalBytes float64 `json:"mem_total_bytes"`
}
System represents a system stats of a node
type Task ¶
type Task struct {
// Missing fields
// TODO: "labels": [],
ExecutorID string `json:"executor_id"`
FrameworkID string `json:"framework_id"`
ID string `json:"id"`
Name string `json:"name"`
Resources Resources `json:"resources"`
SlaveID string `json:"slave_id"`
State string `json:"state"`
Statuses []TaskStatus `json:"statuses"`
Discovery TaskDiscovery `json:"discovery"`
Container Container `json:"container"`
}
Task represent a single Mesos task
type TaskDiscovery ¶
type TaskDiscovery struct {
Visibility string `json:"visibility"`
Name string `json:"name"`
Ports Ports `json:"ports"`
}
TaskDiscovery represents the dicovery information of a task
type TaskStatus ¶
type TaskStatus struct {
State string `json:"state"`
Timestamp float64 `json:"timestamp"`
ContainerStatus ContainerStatus `json:"container_status"`
}
TaskStatus represents the status of a single task