package cgroups

import "github.com/opencontainers/runtime-tools/cgroups"

Index

Variables

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

Source Files

cgroups.go cgroups_v1.go cgroups_v2.go

Version
v0.6.0
Published
May 16, 2018
Platform
windows/amd64
Imports
10 packages
Last checked
17 hours ago

Tools for package owners.