cgroup

package
v0.0.0-...-7e66950 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyNotFoundError = errors.New("key not found")

Functions

func Add

func Add(cg string) error

Add a cgroup.

func Current

func Current() (string, error)

Current cgroup of the process.

func IsV2

func IsV2() (bool, error)

IsV2 returns true if the host is using cgroup v2.

func MockOsRemove

func MockOsRemove(m func(p string) error) (restore func())

Use only from tests, from cross package mocking

func MockProcSelfCgroup

func MockProcSelfCgroup(p string) (restore func())

Use only from tests, from cross package mocking

func MockSysFsCgroup

func MockSysFsCgroup(p string) (restore func())

Use only from tests, from cross package mocking

func MovePidTo

func MovePidTo(pid int, cg string) error

MovePidTo moves the provided pid to a cgroup.

func ReadKVProperty

func ReadKVProperty(cg, property, key string) (value string, err error)

ReadKVProperty returns the value of a given key from the property, eg. oom_group_kill from memory.events.local.

func Remove

func Remove(cg string) error

Remove a cgroup.

func WriteProperty

func WriteProperty(cg, property, value string) error

WriteProperty writes the provided value to the given property.

Types

This section is empty.

Jump to

Keyboard shortcuts

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