resources

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contain

func Contain(logger hclog.Logger, cgroup *configs.Cgroup) *containment

Types

type Containment

type Containment interface {
	// Apply enables containment on pid.
	Apply(pid int) error

	// Cleanup will purge executor resources like cgroups.
	Cleanup() error

	// GetPIDs will return the processes overseen by the Containment
	GetPIDs() PIDs
}

A Containment will cleanup resources created by an executor.

type PID

type PID struct {
	PID           int
	StatsTotalCPU *stats.CpuStats
	StatsUserCPU  *stats.CpuStats
	StatsSysCPU   *stats.CpuStats
}

PID holds one task's pid and it's cpu percentage calculator

func NewPID

func NewPID(pid int) *PID

type PIDs

type PIDs map[int]*PID

PIDs holds all of a task's pids and their cpu percentage calculators

Jump to

Keyboard shortcuts

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