info

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION = "0.4.0"

Version of cAdvisor.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerInfo

type ContainerInfo struct {
	ContainerReference

	// The direct subcontainers of the current container.
	Subcontainers []ContainerReference `json:"subcontainers,omitempty"`

	// The isolation used in the container.
	Spec *ContainerSpec `json:"spec,omitempty"`

	// Historical statistics gathered from the container.
	Stats []*ContainerStats `json:"stats,omitempty"`
}

func (*ContainerInfo) Eq

func (self *ContainerInfo) Eq(b *ContainerInfo) bool

ContainerInfo may be (un)marshaled by json or other en/decoder. In that case, the Timestamp field in each stats/sample may not be precisely en/decoded. This will lead to small but acceptable differences between a ContainerInfo and its encode-then-decode version. Eq() is used to compare two ContainerInfo accepting small difference (<10ms) of Time fields.

func (*ContainerInfo) StatsAfter

func (self *ContainerInfo) StatsAfter(ref time.Time) []*ContainerStats

func (*ContainerInfo) StatsEndTime

func (self *ContainerInfo) StatsEndTime() time.Time

func (*ContainerInfo) StatsStartTime

func (self *ContainerInfo) StatsStartTime() time.Time

type ContainerInfoRequest

type ContainerInfoRequest struct {
	// Max number of stats to return.
	NumStats int `json:"num_stats,omitempty"`
}

ContainerInfoQuery is used when users check a container info from the REST api. It specifies how much data users want to get about a container

type ContainerReference

type ContainerReference struct {
	// The absolute name of the container.
	Name string `json:"name"`

	Aliases []string `json:"aliases,omitempty"`
}

Container reference contains enough information to uniquely identify a container

type ContainerSpec

type ContainerSpec struct {
	Cpu    *CpuSpec    `json:"cpu,omitempty"`
	Memory *MemorySpec `json:"memory,omitempty"`
}

type ContainerStats

type ContainerStats struct {
	// The time of this stat point.
	Timestamp time.Time     `json:"timestamp"`
	Cpu       *CpuStats     `json:"cpu,omitempty"`
	Memory    *MemoryStats  `json:"memory,omitempty"`
	Network   *NetworkStats `json:"network,omitempty"`
}

func (*ContainerStats) Copy

func (self *ContainerStats) Copy(dst *ContainerStats) *ContainerStats

Makes a deep copy of the ContainerStats and returns a pointer to the new copy. Copy() will allocate a new ContainerStats object if dst is nil.

func (*ContainerStats) Eq

This function is useful because we do not require precise time representation.

func (*ContainerStats) StatsEq

func (a *ContainerStats) StatsEq(b *ContainerStats) bool

Checks equality of the stats values.

type CpuSpec

type CpuSpec struct {
	Limit    uint64 `json:"limit"`
	MaxLimit uint64 `json:"max_limit"`
	Mask     string `json:"mask,omitempty"`
}

type CpuStats

type CpuStats struct {
	Usage struct {
		// Total CPU usage.
		// Units: nanoseconds
		Total uint64 `json:"total"`

		// Per CPU/core usage of the container.
		// Unit: nanoseconds.
		PerCpu []uint64 `json:"per_cpu_usage,omitempty"`

		// Time spent in user space.
		// Unit: nanoseconds
		User uint64 `json:"user"`

		// Time spent in kernel space.
		// Unit: nanoseconds
		System uint64 `json:"system"`
	} `json:"usage"`
	Load int32 `json:"load"`
}

All CPU usage metrics are cumulative from the creation of the container

type Interference

type Interference struct {
	// Absolute name of the antagonist container name. This field
	// should not be empty.
	Antagonist string `json:"antagonist"`

	// The absolute path of the victims. This field should not be empty.
	Victims []string `json:"victims"`

	// The name of the detector used to detect this antagonism. This field
	// should not be empty
	Detector string `json:"detector"`

	// Human readable description of this interference
	Description string `json:"description,omitempty"`
}

This struct describes one type of relationship between containers: One container, antagonist, interferes the performance of other containers, victims.

type MachineInfo

type MachineInfo struct {
	// The number of cores in this machine.
	NumCores int `json:"num_cores"`

	// The amount of memory (in bytes) in this machine
	MemoryCapacity int64 `json:"memory_capacity"`
}

type MachineInfoFactory

type MachineInfoFactory interface {
	GetMachineInfo() (*MachineInfo, error)
	GetVersionInfo() (*VersionInfo, error)
}

type MemorySpec

type MemorySpec struct {
	// The amount of memory requested. Default is unlimited (-1).
	// Units: bytes.
	Limit uint64 `json:"limit,omitempty"`

	// The amount of guaranteed memory.  Default is 0.
	// Units: bytes.
	Reservation uint64 `json:"reservation,omitempty"`

	// The amount of swap space requested. Default is unlimited (-1).
	// Units: bytes.
	SwapLimit uint64 `json:"swap_limit,omitempty"`
}

type MemoryStats

type MemoryStats struct {
	// Memory limit, equivalent to "limit" in MemorySpec.
	// Units: Bytes.
	Limit uint64 `json:"limit,omitempty"`

	// Current memory usage, this includes all memory regardless of when it was
	// accessed.
	// Units: Bytes.
	Usage uint64 `json:"usage,omitempty"`

	// The amount of working set memory, this includes recently accessed memory,
	// dirty memory, and kernel memory. Working set is <= "usage".
	// Units: Bytes.
	WorkingSet uint64 `json:"working_set,omitempty"`

	ContainerData    MemoryStatsMemoryData `json:"container_data,omitempty"`
	HierarchicalData MemoryStatsMemoryData `json:"hierarchical_data,omitempty"`
}

type MemoryStatsMemoryData

type MemoryStatsMemoryData struct {
	Pgfault    uint64 `json:"pgfault,omitempty"`
	Pgmajfault uint64 `json:"pgmajfault,omitempty"`
}

type NetworkStats

type NetworkStats struct {
	// Cumulative count of bytes received.
	RxBytes uint64 `json:"rx_bytes"`
	// Cumulative count of packets received.
	RxPackets uint64 `json:"rx_packets"`
	// Cumulative count of receive errors encountered.
	RxErrors uint64 `json:"rx_errors"`
	// Cumulative count of packets dropped while receiving.
	RxDropped uint64 `json:"rx_dropped"`
	// Cumulative count of bytes transmitted.
	TxBytes uint64 `json:"tx_bytes"`
	// Cumulative count of packets transmitted.
	TxPackets uint64 `json:"tx_packets"`
	// Cumulative count of transmit errors encountered.
	TxErrors uint64 `json:"tx_errors"`
	// Cumulative count of packets dropped while transmitting.
	TxDropped uint64 `json:"tx_dropped"`
}

type VersionInfo

type VersionInfo struct {
	// Kernel version.
	KernelVersion string `json:"kernel_version"`

	// OS image being used for cadvisor container, or host image if running on host directly.
	ContainerOsVersion string `json:"container_os_version"`

	// Docker version.
	DockerVersion string `json:"docker_version"`

	// cAdvisor version.
	CadvisorVersion string `json:"cadvisor_version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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