cgroups

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller represents a named controller for a process

func (*Controller) Set

func (c *Controller) Set(name string, value interface{}) error

Set sets the value of a controller setting

type Manager

type Manager interface {
	// GetProcessControllers returns the mapping between controller types and
	// their paths inside cgroup fs for the specified PID.
	GetProcessControllers() (map[string]string, error)
	// GetProcessController returns a named resource Controller for the specified PID.
	GetProcessController(controllerName string) (*Controller, error)
	// MoveProcess move the process to the path under a cgroup controller
	MoveProcess(controller, path string) error
}

Manager provides an interface to operate on linux cgroups

func NewManager

func NewManager(pid interface{}, fsys fs.FileSystem) Manager

NewManager returns an instance of RealManager

type RealManager

type RealManager struct {
	// contains filtered or unexported fields
}

RealManager provides an implementation of Manager which is using default linux system paths to access info about cgroups for processes.

func (*RealManager) GetProcessController

func (c *RealManager) GetProcessController(controllerName string) (*Controller, error)

GetProcessController is an implementation of GetProcessController method of Manager interface.

func (*RealManager) GetProcessControllers

func (c *RealManager) GetProcessControllers() (map[string]string, error)

GetProcessControllers is an implementation of GetProcessControllers method of Manager interface.

func (*RealManager) MoveProcess

func (c *RealManager) MoveProcess(controller, path string) error

MoveProcess implements MoveProcess method of Manager

Jump to

Keyboard shortcuts

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