agent

package
v0.0.0-...-f25ceec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterMonitor

type ClusterMonitor struct {
	DockerClient *client.Client
	// contains filtered or unexported fields
}

ClusterMonitor is used to collect data from a whole docker host. It may include many clusters

func (*ClusterMonitor) CollectData

func (clm *ClusterMonitor) CollectData() (*data.ClusterStat, error)

CollectData will collect information from docker host

func (*ClusterMonitor) Init

func (clm *ClusterMonitor) Init(cluster *data.Cluster, output *data.DB, dockerClient *client.Client) error

Init will finish the initialization

func (*ClusterMonitor) Monit

func (clm *ClusterMonitor) Monit(cluster data.Cluster, outputDB *data.DB, outputCol string, dockerClient *client.Client, c chan *data.ClusterStat)

Monit will write pointer of result to the channel Even fail, must write nil

type ContainerMonitor

type ContainerMonitor struct {
	DaemonURL string
	// contains filtered or unexported fields
}

ContainerMonitor is used to collect data from a docker host

func (*ContainerMonitor) CollectData

func (ctm *ContainerMonitor) CollectData() (*data.ContainerStat, error)

CollectData will collect info for a given container and store into db Will return pointer of the record struct

func (*ContainerMonitor) Init

func (ctm *ContainerMonitor) Init(dockerClient *client.Client, daemonURL, containerID, containerName, outputCol string, outputDB *data.DB) error

Init will finish the setup This should be call first before using any other method

func (*ContainerMonitor) ListContainer

func (ctm *ContainerMonitor) ListContainer() ([]types.Container, error)

ListContainer will get all existing containers on the host @deprecated, just keep for testing

func (*ContainerMonitor) Monit

func (ctm *ContainerMonitor) Monit(dockerClient *client.Client, daemonURL, containerID, containerName, outputCol string, outputDB *data.DB, c chan *data.ContainerStat)

Monit will collect data for a container, exactly return a result pointer to chan

type HostMonitor

type HostMonitor struct {
	// contains filtered or unexported fields
}

HostMonitor is used to collect data from a whole docker host. It may include many clusters

func (*HostMonitor) CollectData

func (hm *HostMonitor) CollectData() (*data.HostStat, error)

CollectData will collect information for each cluster at the host

func (*HostMonitor) Init

func (hm *HostMonitor) Init(host *data.Host, input, output *data.DB, colName string) error

Init will do initialization

func (*HostMonitor) Monit

func (hm *HostMonitor) Monit(host data.Host, inputDB, outputDB *data.DB, c chan string)

Monit will start the monit task on the host

type Monitor

type Monitor interface {
	CollectData(db *data.DB) (map[string]interface{}, error)
}

Monitor is used to collect data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL