docker

package
v0.0.0-...-14435e2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCgroupNotAvailable = errors.New("cgroup not available")
View Source
var ErrDockerNotAvailable = errors.New("docker not available")

Functions

func CgroupCPU

func CgroupCPU(containerId string, base string) (*cpu.CPUTimesStat, error)

CgroupCPU returnes specified cgroup id CPU status. containerId is same as docker id if you use docker. If you use container via systemd.slice, you could use containerId = docker-<container id>.scope and base=/sys/fs/cgroup/cpuacct/system.slice/

func CgroupCPUDocker

func CgroupCPUDocker(containerid string) (*cpu.CPUTimesStat, error)

func GetDockerIDList

func GetDockerIDList() ([]string, error)

GetDockerIDList returnes a list of DockerID. This requires certain permission.

Types

type CgroupMemStat

type CgroupMemStat struct {
	ContainerID             string `json:"container_id"`
	Cache                   uint64 `json:"cache"`
	RSS                     uint64 `json:"rss"`
	RSSHuge                 uint64 `json:"rss_huge"`
	MappedFile              uint64 `json:"mapped_file"`
	Pgpgin                  uint64 `json:"pgpgin"`
	Pgpgout                 uint64 `json:"pgpgout"`
	Pgfault                 uint64 `json:"pgfault"`
	Pgmajfault              uint64 `json:"pgmajfault"`
	InactiveAnon            uint64 `json:"inactive_anon"`
	ActiveAnon              uint64 `json:"active_anon"`
	InactiveFile            uint64 `json:"inactive_file"`
	ActiveFile              uint64 `json:"active_file"`
	Unevictable             uint64 `json:"unevictable"`
	HierarchicalMemoryLimit uint64 `json:"hierarchical_memory_limit"`
	TotalCache              uint64 `json:"total_cache"`
	TotalRSS                uint64 `json:"total_rss"`
	TotalRSSHuge            uint64 `json:"total_rss_huge"`
	TotalMappedFile         uint64 `json:"total_mapped_file"`
	TotalPgpgIn             uint64 `json:"total_pgpgin"`
	TotalPgpgOut            uint64 `json:"total_pgpgout"`
	TotalPgFault            uint64 `json:"total_pgfault"`
	TotalPgMajFault         uint64 `json:"total_pgmajfault"`
	TotalInactiveAnon       uint64 `json:"total_inactive_anon"`
	TotalActiveAnon         uint64 `json:"total_active_anon"`
	TotalInactiveFile       uint64 `json:"total_inactive_file"`
	TotalActiveFile         uint64 `json:"total_active_file"`
	TotalUnevictable        uint64 `json:"total_unevictable"`
	MemUsageInBytes         uint64 `json:"mem_usage_in_bytes"`
	MemMaxUsageInBytes      uint64 `json:"mem_max_usage_in_bytes"`
	MemLimitInBytes         uint64 `json:"memory.limit_in_bytes"`
	MemFailCnt              uint64 `json:"memory.failcnt"`
}

func CgroupMem

func CgroupMem(containerId string, base string) (*CgroupMemStat, error)

func CgroupMemDocker

func CgroupMemDocker(containerId string) (*CgroupMemStat, error)

func (CgroupMemStat) String

func (m CgroupMemStat) String() string

Jump to

Keyboard shortcuts

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