fs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 6 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OOMKillCount

func OOMKillCount(path string) (uint64, error)

Types

type BlkioGroup

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

func (*BlkioGroup) Apply

func (s *BlkioGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*BlkioGroup) GetStats

func (s *BlkioGroup) GetStats(path string, stats *cgroups.Stats) error

func (*BlkioGroup) ID added in v0.0.7

func (s *BlkioGroup) ID() cgroups.Controller

ID returns the controller ID for blkio subsystem.

func (*BlkioGroup) Name

func (s *BlkioGroup) Name() string

func (*BlkioGroup) Set

func (s *BlkioGroup) Set(path string, r *cgroups.Resources) error

type CpuGroup

type CpuGroup struct{}

func (*CpuGroup) Apply

func (s *CpuGroup) Apply(path string, r *cgroups.Resources, pid int) error

func (*CpuGroup) GetStats

func (s *CpuGroup) GetStats(path string, stats *cgroups.Stats) error

func (*CpuGroup) ID added in v0.0.7

func (s *CpuGroup) ID() cgroups.Controller

ID returns the controller ID for CPU subsystem.

func (*CpuGroup) Name

func (s *CpuGroup) Name() string

func (*CpuGroup) Set

func (s *CpuGroup) Set(path string, r *cgroups.Resources) error

func (*CpuGroup) SetRtSched

func (s *CpuGroup) SetRtSched(path string, r *cgroups.Resources) error

type CpuacctGroup

type CpuacctGroup struct{}

func (*CpuacctGroup) Apply

func (s *CpuacctGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*CpuacctGroup) GetStats

func (s *CpuacctGroup) GetStats(path string, stats *cgroups.Stats) error

func (*CpuacctGroup) ID added in v0.0.7

ID returns the controller ID for cpuacct subsystem.

func (*CpuacctGroup) Name

func (s *CpuacctGroup) Name() string

func (*CpuacctGroup) Set

func (s *CpuacctGroup) Set(_ string, _ *cgroups.Resources) error

type CpusetGroup

type CpusetGroup struct{}

func (*CpusetGroup) Apply

func (s *CpusetGroup) Apply(path string, r *cgroups.Resources, pid int) error

func (*CpusetGroup) ApplyDir

func (s *CpusetGroup) ApplyDir(dir string, r *cgroups.Resources, pid int) error

func (*CpusetGroup) GetStats

func (s *CpusetGroup) GetStats(path string, stats *cgroups.Stats) error

func (*CpusetGroup) ID added in v0.0.7

func (s *CpusetGroup) ID() cgroups.Controller

ID returns the controller ID for cpuset subsystem.

func (*CpusetGroup) Name

func (s *CpusetGroup) Name() string

func (*CpusetGroup) Set

func (s *CpusetGroup) Set(path string, r *cgroups.Resources) error

type DevicesGroup

type DevicesGroup struct{}

func (*DevicesGroup) Apply

func (s *DevicesGroup) Apply(path string, r *cgroups.Resources, pid int) error

func (*DevicesGroup) GetStats

func (s *DevicesGroup) GetStats(path string, stats *cgroups.Stats) error

func (*DevicesGroup) ID added in v0.0.7

ID returns the controller ID for devices subsystem. Returns 0 as devices is not a cgroups.Controller.

func (*DevicesGroup) Name

func (s *DevicesGroup) Name() string

func (*DevicesGroup) Set

func (s *DevicesGroup) Set(path string, r *cgroups.Resources) error

type FreezerGroup

type FreezerGroup struct{}

func (*FreezerGroup) Apply

func (s *FreezerGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*FreezerGroup) GetState

func (s *FreezerGroup) GetState(path string) (cgroups.FreezerState, error)

func (*FreezerGroup) GetStats

func (s *FreezerGroup) GetStats(path string, stats *cgroups.Stats) error

func (*FreezerGroup) ID added in v0.0.7

ID returns the controller ID for freezer subsystem. Returns 0 as freezer is not a cgroups.Controller.

func (*FreezerGroup) Name

func (s *FreezerGroup) Name() string

func (*FreezerGroup) Set

func (s *FreezerGroup) Set(path string, r *cgroups.Resources) (Err error)

type HugetlbGroup

type HugetlbGroup struct{}

func (*HugetlbGroup) Apply

func (s *HugetlbGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*HugetlbGroup) GetStats

func (s *HugetlbGroup) GetStats(path string, stats *cgroups.Stats) error

func (*HugetlbGroup) ID added in v0.0.7

ID returns the controller ID for hugetlb subsystem.

func (*HugetlbGroup) Name

func (s *HugetlbGroup) Name() string

func (*HugetlbGroup) Set

func (s *HugetlbGroup) Set(path string, r *cgroups.Resources) error

type Manager

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

func NewManager

func NewManager(cg *cgroups.Cgroup, paths map[string]string) (*Manager, error)

func (*Manager) AddPid added in v0.0.5

func (m *Manager) AddPid(subcgroup string, pid int) (retErr error)

AddPid adds a process with a given pid to an existing cgroup. The subcgroup argument is either empty, or a path relative to a cgroup under under the manager's cgroup.

func (*Manager) Apply

func (m *Manager) Apply(pid int) (retErr error)

func (*Manager) Destroy

func (m *Manager) Destroy() error

func (*Manager) Exists

func (m *Manager) Exists() bool

func (*Manager) Freeze

func (m *Manager) Freeze(state cgroups.FreezerState) error

Freeze toggles the container's freezer cgroup depending on the state provided

func (*Manager) GetAllPids

func (m *Manager) GetAllPids() ([]int, error)

func (*Manager) GetCgroups

func (m *Manager) GetCgroups() (*cgroups.Cgroup, error)

func (*Manager) GetFreezerState

func (m *Manager) GetFreezerState() (cgroups.FreezerState, error)

func (*Manager) GetPaths

func (m *Manager) GetPaths() map[string]string

func (*Manager) GetPids

func (m *Manager) GetPids() ([]int, error)

func (*Manager) GetStats

func (m *Manager) GetStats() (*cgroups.Stats, error)

func (*Manager) OOMKillCount

func (m *Manager) OOMKillCount() (uint64, error)

func (*Manager) Path

func (m *Manager) Path(subsys string) string

func (*Manager) Set

func (m *Manager) Set(r *cgroups.Resources) error

func (*Manager) Stats added in v0.0.7

func (m *Manager) Stats(opts *cgroups.StatsOptions) (*cgroups.Stats, error)

Stats returns cgroup statistics for the specified controllers.

type MemoryGroup

type MemoryGroup struct{}

func (*MemoryGroup) Apply

func (s *MemoryGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*MemoryGroup) GetStats

func (s *MemoryGroup) GetStats(path string, stats *cgroups.Stats) error

func (*MemoryGroup) ID added in v0.0.7

func (s *MemoryGroup) ID() cgroups.Controller

ID returns the controller ID for memory subsystem.

func (*MemoryGroup) Name

func (s *MemoryGroup) Name() string

func (*MemoryGroup) Set

func (s *MemoryGroup) Set(path string, r *cgroups.Resources) error

type NameGroup

type NameGroup struct {
	GroupName string
	Join      bool
	GroupID   cgroups.Controller
}

func (*NameGroup) Apply

func (s *NameGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*NameGroup) GetStats

func (s *NameGroup) GetStats(path string, stats *cgroups.Stats) error

func (*NameGroup) ID added in v0.0.7

func (s *NameGroup) ID() cgroups.Controller

ID returns the controller ID for named subsystem.

func (*NameGroup) Name

func (s *NameGroup) Name() string

func (*NameGroup) Set

func (s *NameGroup) Set(_ string, _ *cgroups.Resources) error

type NetClsGroup

type NetClsGroup struct{}

func (*NetClsGroup) Apply

func (s *NetClsGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*NetClsGroup) GetStats

func (s *NetClsGroup) GetStats(path string, stats *cgroups.Stats) error

func (*NetClsGroup) ID added in v0.0.7

func (s *NetClsGroup) ID() cgroups.Controller

ID returns the controller ID for net_cls subsystem. Returns 0 as net_cls is not a cgroups.Controller.

func (*NetClsGroup) Name

func (s *NetClsGroup) Name() string

func (*NetClsGroup) Set

func (s *NetClsGroup) Set(path string, r *cgroups.Resources) error

type NetPrioGroup

type NetPrioGroup struct{}

func (*NetPrioGroup) Apply

func (s *NetPrioGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*NetPrioGroup) GetStats

func (s *NetPrioGroup) GetStats(path string, stats *cgroups.Stats) error

func (*NetPrioGroup) ID added in v0.0.7

ID returns the controller ID for net_prio subsystem. Returns 0 as net_prio is not a cgroups.Controller.

func (*NetPrioGroup) Name

func (s *NetPrioGroup) Name() string

func (*NetPrioGroup) Set

func (s *NetPrioGroup) Set(path string, r *cgroups.Resources) error

type PerfEventGroup

type PerfEventGroup struct{}

func (*PerfEventGroup) Apply

func (s *PerfEventGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*PerfEventGroup) GetStats

func (s *PerfEventGroup) GetStats(path string, stats *cgroups.Stats) error

func (*PerfEventGroup) ID added in v0.0.7

ID returns the controller ID for perf_event subsystem. Returns 0 as perf_event is not a cgroups.Controller.

func (*PerfEventGroup) Name

func (s *PerfEventGroup) Name() string

func (*PerfEventGroup) Set

type PidsGroup

type PidsGroup struct{}

func (*PidsGroup) Apply

func (s *PidsGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*PidsGroup) GetStats

func (s *PidsGroup) GetStats(path string, stats *cgroups.Stats) error

func (*PidsGroup) ID added in v0.0.7

func (s *PidsGroup) ID() cgroups.Controller

ID returns the controller ID for pids subsystem.

func (*PidsGroup) Name

func (s *PidsGroup) Name() string

func (*PidsGroup) Set

func (s *PidsGroup) Set(path string, r *cgroups.Resources) error

type RdmaGroup

type RdmaGroup struct{}

func (*RdmaGroup) Apply

func (s *RdmaGroup) Apply(path string, _ *cgroups.Resources, pid int) error

func (*RdmaGroup) GetStats

func (s *RdmaGroup) GetStats(path string, stats *cgroups.Stats) error

func (*RdmaGroup) ID added in v0.0.7

func (s *RdmaGroup) ID() cgroups.Controller

ID returns the controller ID for rdma subsystem.

func (*RdmaGroup) Name

func (s *RdmaGroup) Name() string

func (*RdmaGroup) Set

func (s *RdmaGroup) Set(path string, r *cgroups.Resources) error

Jump to

Keyboard shortcuts

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