libcontainer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCgroupSubsystems

func GetCgroupSubsystems(includedMetrics container.MetricSet) (map[string]string, error)

GetCgroupSubsystems returns information about the cgroup subsystems that are of interest as a map of cgroup controllers to their mount points. For example, "cpu" -> "/sys/fs/cgroup/cpu".

The incudeMetrics arguments specifies which metrics are requested, and is used to filter out some cgroups and their mounts. If nil, all supported cgroup subsystems are included.

For cgroup v2, includedMetrics argument is unused, the only map key is "" (empty string), and the value is the unified cgroup mount point.

func NewCgroupManager

func NewCgroupManager(name string, paths map[string]string) (cgroups.Manager, error)

Types

type Handler

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

func NewHandler

func NewHandler(cgroupManager cgroups.Manager, rootFs string, pid int, includedMetrics container.MetricSet) *Handler

func (*Handler) GetProcesses

func (h *Handler) GetProcesses() ([]int, error)

func (*Handler) GetStats

func (h *Handler) GetStats() (*info.ContainerStats, error)

Get cgroup and networking stats of the specified container

Jump to

Keyboard shortcuts

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