Documentation ¶
Index ¶
- Constants
- type ContainerInfo
- type ContainerInfoRequest
- type ContainerReference
- type ContainerSpec
- type ContainerStats
- type CpuSpec
- type CpuStats
- type DiskIoStats
- type FsInfo
- type FsStats
- type Interference
- type MachineInfo
- type MachineInfoFactory
- type MemorySpec
- type MemoryStats
- type MemoryStatsMemoryData
- type NetworkStats
- type PerDiskStats
- type VersionInfo
Constants ¶
const VERSION = "0.5.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 ContainerStats ¶
type ContainerStats struct { // The time of this stat point. Timestamp time.Time `json:"timestamp"` Cpu *CpuStats `json:"cpu,omitempty"` DiskIo DiskIoStats `json:"diskio,omitempty"` Memory *MemoryStats `json:"memory,omitempty"` Network *NetworkStats `json:"network,omitempty"` // Filesystem statistics Filesystem []FsStats `json:"filesystem,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 ¶
func (a *ContainerStats) Eq(b *ContainerStats) bool
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 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 DiskIoStats ¶ added in v0.5.1
type DiskIoStats struct { IoServiceBytes []PerDiskStats `json:"io_service_bytes,omitempty"` IoServiced []PerDiskStats `json:"io_serviced,omitempty"` IoQueued []PerDiskStats `json:"io_queued,omitempty"` Sectors []PerDiskStats `json:"sectors,omitempty"` }
type FsStats ¶ added in v0.5.1
type FsStats struct { // The block device name associated with the filesystem. Device string `json:"device,omitempty"` // Number of bytes that can be consumed by the container on this filesystem. Limit uint64 `json:"capacity"` // Number of bytes that is consumed by the container on this filesystem. Usage uint64 `json:"usage"` }
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 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 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 PerDiskStats ¶ added in v0.5.1
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"` }