Documentation ¶
Index ¶
- Constants
- Variables
- func AddLabels(nmd report.Node, labels map[string]string)
- func ExtractContainerIPs(nmd report.Node) []string
- func ExtractContainerIPsWithScopes(nmd report.Node) []string
- func ExtractLabels(nmd report.Node) map[string]string
- type Client
- type ClientConn
- type Container
- type Registry
- type Reporter
- type Tagger
Constants ¶
const ( ContainerName = "docker_container_name" ContainerCommand = "docker_container_command" ContainerPorts = "docker_container_ports" ContainerCreated = "docker_container_created" ContainerIPs = "docker_container_ips" ContainerHostname = "docker_container_hostname" ContainerIPsWithScopes = "docker_container_ips_with_scopes" NetworkRxDropped = "network_rx_dropped" NetworkRxBytes = "network_rx_bytes" NetworkRxErrors = "network_rx_errors" NetworkTxPackets = "network_tx_packets" NetworkTxDropped = "network_tx_dropped" NetworkRxPackets = "network_rx_packets" NetworkTxErrors = "network_tx_errors" NetworkTxBytes = "network_tx_bytes" MemoryMaxUsage = "memory_max_usage" MemoryUsage = "memory_usage" MemoryFailcnt = "memory_failcnt" MemoryLimit = "memory_limit" CPUPercpuUsage = "cpu_per_cpu_usage" CPUUsageInUsermode = "cpu_usage_in_usermode" CPUTotalUsage = "cpu_total_usage" CPUUsageInKernelmode = "cpu_usage_in_kernelmode" CPUSystemCPUUsage = "cpu_system_cpu_usage" )
These constants are keys used in node metadata
const ( StartEvent = "start" DieEvent = "die" )
Consts exported for testing.
const ( ImageID = "docker_image_id" ImageName = "docker_image_name" )
Keys for use in Node
const ( ContainerID = "docker_container_id" Domain = "domain" // TODO this is ambiguous, be more specific Name = "name" // TODO this is ambiguous, be more specific )
Node metadata keys.
const LabelPrefix = "docker_label_"
LabelPrefix is the key prefix used for Docker labels in Node (e.g. a Docker label "labelKey"="labelValue" will get encoded as "docker_label_labelKey"="dockerValue" in the metadata)
Variables ¶
var ( DialStub = net.Dial NewClientConnStub = newClientConn )
Exported for testing
var ( NewDockerClientStub = newDockerClient NewContainerStub = NewContainer )
Vars exported for testing.
var (
NewProcessTreeStub = process.NewTree
)
These vars are exported for testing.
Functions ¶
func ExtractContainerIPs ¶ added in v0.7.0
ExtractContainerIPs returns the list of container IPs given a Node from the Container topology.
func ExtractContainerIPsWithScopes ¶ added in v0.9.0
ExtractContainerIPsWithScopes returns the list of container IPs, prepended with scopes, given a Node from the Container topology.
Types ¶
type Client ¶
type Client interface { ListContainers(docker_client.ListContainersOptions) ([]docker_client.APIContainers, error) InspectContainer(string) (*docker_client.Container, error) ListImages(docker_client.ListImagesOptions) ([]docker_client.APIImages, error) AddEventListener(chan<- *docker_client.APIEvents) error RemoveEventListener(chan *docker_client.APIEvents) error }
Client interface for mocking.
type ClientConn ¶
ClientConn is exported for testing
type Container ¶
type Container interface { ID() string Image() string PID() int Hostname() string GetNode(string, []net.IP) report.Node StartGatheringStats() error StopGatheringStats() }
Container represents a Docker container
func NewContainer ¶
NewContainer creates a new Container
type Registry ¶
type Registry interface { Stop() LockedPIDLookup(f func(func(int) Container)) WalkContainers(f func(Container)) WalkImages(f func(*docker_client.APIImages)) }
Registry keeps track of running docker containers and their images
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter generate Reports containing Container and ContainerImage topologies
func NewReporter ¶
NewReporter makes a new Reporter