cgroup

package
v0.0.0-...-88aa921 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cpuacct string = "cpuacct"
	Memory  string = "memory"
)

Variables

This section is empty.

Functions

func GetCgroupDockerStatsFilePath

func GetCgroupDockerStatsFilePath(dockerID string, stat string) string

Helper function that takes a docker ID and parameter (to specify cpu or memory) and returns a path to the correct stats file

Types

type BlkioIoQueued

type BlkioIoQueued struct {
	Total int64
}

BlkioIoQueued stores data from /sys/fs/cgroup/blkio/blkio.io_queued.

func ReadBlkioIoQueued

func ReadBlkioIoQueued(fileName string) (*BlkioIoQueued, error)

ReadBlkioIoQueued fills out and returns a BlkioIoQueued struct from the given file name. if fileName is "", the default path of /sys/fs/cgroup/blkio/blkio.io_queued is used.

type BlkioIoServiceBytes

type BlkioIoServiceBytes struct {
	Total int64
}

BlkioIoServiceBytes stores data from /sys/fs/cgroup/blkio/blkio.io_service_bytes.

func ReadBlkioIoServiceBytes

func ReadBlkioIoServiceBytes(fileName string) (*BlkioIoServiceBytes, error)

ReadBlkioIoServiceBytes fills out and returns a BlkioIoServiceBytes struct from the given file name. if fileName is "", the default path of /sys/fs/cgroup/blkio/blkio.io_service_bytes is used.

type BlkioIoServiced

type BlkioIoServiced struct {
	Total int64
}

BlkioIoServiced stores data from /sys/fs/cgroup/blkio/blkio.io_serviced.

func ReadBlkioIoServiced

func ReadBlkioIoServiced(fileName string) (*BlkioIoServiced, error)

ReadBlkioIoServiced fills out and returns a BlkioIoServiced struct from the given file name. if fileName is "", the default path of /sys/fs/cgroup/blkio/blkio.io_serviced is used.

type CpuacctStat

type CpuacctStat struct {
	User   int64
	System int64
}

CpuacctStat stores data from /sys/fs/cgroup/cpuacct/cpuacct.stat.

func ReadCpuacctStat

func ReadCpuacctStat(fileName string) (*CpuacctStat, error)

ReadCpuacctStat fills out and returns a CpuacctStat struct from the given file name. if fileName is "", the default path of /sys/fs/cgroup/cpuacct/cpuacct.stat is used.

type MemoryStat

type MemoryStat struct {
	Cache                   int64
	Rss                     int64
	RssHuge                 int64
	MappedFile              int64
	Pgpgin                  int64
	Pgpgout                 int64
	Pgfault                 int64
	Pgmajfault              int64
	InactiveAnon            int64
	ActiveAnon              int64
	InactiveFile            int64
	ActiveFile              int64
	Unevictable             int64
	HierarchicalMemoryLimit int64
	TotalCache              int64
	TotalRss                int64
	TotalRssHuge            int64
	TotalMappedFile         int64
	TotalPgpgin             int64
	TotalPgpgout            int64
	TotalPgfault            int64
	TotalPgmajfault         int64
	TotalInactiveAnon       int64
	TotalActiveAnon         int64
	TotalInactiveFile       int64
	TotalActiveFile         int64
	TotalUnevictable        int64
}

MemoryStat stores data from /sys/fs/cgroup/memory/memory.stat.

func ReadMemoryStat

func ReadMemoryStat(fileName string) (*MemoryStat, error)

ReadMemoryStat fills out and returns a MemoryStat struct from the given file name. if fileName is "", the default path of /sys/fs/cgroup/memory/memory.stat is used.

Jump to

Keyboard shortcuts

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