cgroups

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AbsCgroupPath is absolute path for container's cgroup mount
	AbsCgroupPath = "/cgrouptest"
	// RelCgroupPath is relative path for container's cgroup mount
	RelCgroupPath = "testdir/cgrouptest/container"
)

Functions

func GetBlockIOData

func GetBlockIOData(pid int, cgPath string) (*rspec.LinuxBlockIO, error)

GetBlockIOData gets cgroup blockio data

func GetCPUData

func GetCPUData(pid int, cgPath string) (*rspec.LinuxCPU, error)

GetCPUData gets cgroup cpus data

func GetDevicesData

func GetDevicesData(pid int, cgPath string) ([]rspec.LinuxDeviceCgroup, error)

GetDevicesData gets cgroup devices data

func GetHugepageLimitData

func GetHugepageLimitData(pid int, cgPath string) ([]rspec.LinuxHugepageLimit, error)

GetHugepageLimitData gets cgroup hugetlb data

func GetNetworkData

func GetNetworkData(pid int, cgPath string) (*rspec.LinuxNetwork, error)

GetNetworkData gets cgroup network data

func GetPidsData

func GetPidsData(pid int, cgPath string) (*rspec.LinuxPids, error)

GetPidsData gets cgroup pid ints data

func GetSubsystemPath

func GetSubsystemPath(pid int, subsystem string) (string, error)

GetSubsystemPath gets path of subsystem

Types

type Cgroup

type Cgroup interface {
	GetBlockIOData(pid int, cgPath string) (*rspec.LinuxBlockIO, error)
	GetCPUData(pid int, cgPath string) (*rspec.LinuxCPU, error)
	GetDevicesData(pid int, cgPath string) ([]rspec.LinuxDeviceCgroup, error)
	GetHugepageLimitData(pid int, cgPath string) ([]rspec.LinuxHugepageLimit, error)
	GetMemoryData(pid int, cgPath string) (*rspec.LinuxMemory, error)
	GetNetworkData(pid int, cgPath string) (*rspec.LinuxNetwork, error)
	GetPidsData(pid int, cgPath string) (*rspec.LinuxPids, error)
}

Cgroup represents interfaces for cgroup validation

func FindCgroup

func FindCgroup() (Cgroup, error)

FindCgroup gets cgroup root mountpoint

type CgroupV1

type CgroupV1 struct {
	MountPath string
}

CgroupV1 used for cgroupv1 validation

func (*CgroupV1) GetBlockIOData

func (cg *CgroupV1) GetBlockIOData(pid int, cgPath string) (*rspec.LinuxBlockIO, error)

GetBlockIOData gets cgroup blockio data

func (*CgroupV1) GetCPUData

func (cg *CgroupV1) GetCPUData(pid int, cgPath string) (*rspec.LinuxCPU, error)

GetCPUData gets cgroup cpus data

func (*CgroupV1) GetDevicesData

func (cg *CgroupV1) GetDevicesData(pid int, cgPath string) ([]rspec.LinuxDeviceCgroup, error)

GetDevicesData gets cgroup devices data

func (*CgroupV1) GetHugepageLimitData

func (cg *CgroupV1) GetHugepageLimitData(pid int, cgPath string) ([]rspec.LinuxHugepageLimit, error)

GetHugepageLimitData gets cgroup hugetlb data

func (*CgroupV1) GetMemoryData

func (cg *CgroupV1) GetMemoryData(pid int, cgPath string) (*rspec.LinuxMemory, error)

GetMemoryData gets cgroup memory data

func (*CgroupV1) GetNetworkData

func (cg *CgroupV1) GetNetworkData(pid int, cgPath string) (*rspec.LinuxNetwork, error)

GetNetworkData gets cgroup network data

func (*CgroupV1) GetPidsData

func (cg *CgroupV1) GetPidsData(pid int, cgPath string) (*rspec.LinuxPids, error)

GetPidsData gets cgroup pids data

type CgroupV2

type CgroupV2 struct {
	MountPath string
}

CgroupV2 used for cgroupv2 validation

func (*CgroupV2) GetMemoryData

func (cg *CgroupV2) GetMemoryData(pid int, cgPath string) (*rspec.LinuxMemory, error)

GetMemoryData gets cgroup memory data

Jump to

Keyboard shortcuts

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