Documentation
¶
Overview ¶
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc.
Index ¶
- type Manager
- type ManagerMock
- func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
- func (_m *ManagerMock) IsCgroupV2() bool
- func (_m *ManagerMock) Join(pid int) error
- func (_m *ManagerMock) Read(controller string, file string) (string, error)
- func (_m *ManagerMock) ReadCPUSet() (cpuset.CPUSet, error)
- func (_m *ManagerMock) RelativePath(controller string) string
- func (_m *ManagerMock) Write(controller string, file string, data string) error
- type ManagerMock_Expecter
- func (_e *ManagerMock_Expecter) IsCgroupV2() *ManagerMock_IsCgroupV2_Call
- func (_e *ManagerMock_Expecter) Join(pid interface{}) *ManagerMock_Join_Call
- func (_e *ManagerMock_Expecter) Read(controller interface{}, file interface{}) *ManagerMock_Read_Call
- func (_e *ManagerMock_Expecter) ReadCPUSet() *ManagerMock_ReadCPUSet_Call
- func (_e *ManagerMock_Expecter) RelativePath(controller interface{}) *ManagerMock_RelativePath_Call
- func (_e *ManagerMock_Expecter) Write(controller interface{}, file interface{}, data interface{}) *ManagerMock_Write_Call
- type ManagerMock_IsCgroupV2_Call
- type ManagerMock_Join_Call
- type ManagerMock_ReadCPUSet_Call
- func (_c *ManagerMock_ReadCPUSet_Call) Return(_a0 cpuset.CPUSet, _a1 error) *ManagerMock_ReadCPUSet_Call
- func (_c *ManagerMock_ReadCPUSet_Call) Run(run func()) *ManagerMock_ReadCPUSet_Call
- func (_c *ManagerMock_ReadCPUSet_Call) RunAndReturn(run func() (cpuset.CPUSet, error)) *ManagerMock_ReadCPUSet_Call
- type ManagerMock_Read_Call
- type ManagerMock_RelativePath_Call
- func (_c *ManagerMock_RelativePath_Call) Return(_a0 string) *ManagerMock_RelativePath_Call
- func (_c *ManagerMock_RelativePath_Call) Run(run func(controller string)) *ManagerMock_RelativePath_Call
- func (_c *ManagerMock_RelativePath_Call) RunAndReturn(run func(string) string) *ManagerMock_RelativePath_Call
- type ManagerMock_Write_Call
- func (_c *ManagerMock_Write_Call) Return(_a0 error) *ManagerMock_Write_Call
- func (_c *ManagerMock_Write_Call) Run(run func(controller string, file string, data string)) *ManagerMock_Write_Call
- func (_c *ManagerMock_Write_Call) RunAndReturn(run func(string, string, string) error) *ManagerMock_Write_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Join adds the given PID to all available controllers of the cgroup Join(pid int) error // Read the given cgroup file data and returns the content as a string Read(controller, file string) (string, error) // ReadCPUSet returns defined CPUSet ReadCPUSet() (cpuset.CPUSet, error) // Write the given data to the given cgroup kind Write(controller, file, data string) error // IsCgroupV2 returns true if CGroups are using V2 implementation IsCgroupV2() bool // RelativePath returns the controller relative path RelativePath(controller string) string }
Manager represents a cgroup manager able to join the given cgroup
func NewManager ¶
func NewManager(dryRun bool, pid uint32, cgroupMount string, log *zap.SugaredLogger) (Manager, error)
NewManager creates a new cgroup manager from the given cgroup root path
type ManagerMock ¶
ManagerMock is an autogenerated mock type for the Manager type
func NewManagerMock ¶
func NewManagerMock(t interface { mock.TestingT Cleanup(func()) }) *ManagerMock
NewManagerMock creates a new instance of ManagerMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ManagerMock) EXPECT ¶
func (_m *ManagerMock) EXPECT() *ManagerMock_Expecter
func (*ManagerMock) IsCgroupV2 ¶
func (_m *ManagerMock) IsCgroupV2() bool
IsCgroupV2 provides a mock function with given fields:
func (*ManagerMock) Join ¶
func (_m *ManagerMock) Join(pid int) error
Join provides a mock function with given fields: pid
func (*ManagerMock) Read ¶
func (_m *ManagerMock) Read(controller string, file string) (string, error)
Read provides a mock function with given fields: controller, file
func (*ManagerMock) ReadCPUSet ¶
func (_m *ManagerMock) ReadCPUSet() (cpuset.CPUSet, error)
ReadCPUSet provides a mock function with given fields:
func (*ManagerMock) RelativePath ¶
func (_m *ManagerMock) RelativePath(controller string) string
RelativePath provides a mock function with given fields: controller
type ManagerMock_Expecter ¶
type ManagerMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ManagerMock_Expecter) IsCgroupV2 ¶
func (_e *ManagerMock_Expecter) IsCgroupV2() *ManagerMock_IsCgroupV2_Call
IsCgroupV2 is a helper method to define mock.On call
func (*ManagerMock_Expecter) Join ¶
func (_e *ManagerMock_Expecter) Join(pid interface{}) *ManagerMock_Join_Call
Join is a helper method to define mock.On call
- pid int
func (*ManagerMock_Expecter) Read ¶
func (_e *ManagerMock_Expecter) Read(controller interface{}, file interface{}) *ManagerMock_Read_Call
Read is a helper method to define mock.On call
- controller string
- file string
func (*ManagerMock_Expecter) ReadCPUSet ¶
func (_e *ManagerMock_Expecter) ReadCPUSet() *ManagerMock_ReadCPUSet_Call
ReadCPUSet is a helper method to define mock.On call
func (*ManagerMock_Expecter) RelativePath ¶
func (_e *ManagerMock_Expecter) RelativePath(controller interface{}) *ManagerMock_RelativePath_Call
RelativePath is a helper method to define mock.On call
- controller string
func (*ManagerMock_Expecter) Write ¶
func (_e *ManagerMock_Expecter) Write(controller interface{}, file interface{}, data interface{}) *ManagerMock_Write_Call
Write is a helper method to define mock.On call
- controller string
- file string
- data string
type ManagerMock_IsCgroupV2_Call ¶
ManagerMock_IsCgroupV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsCgroupV2'
func (*ManagerMock_IsCgroupV2_Call) Return ¶
func (_c *ManagerMock_IsCgroupV2_Call) Return(_a0 bool) *ManagerMock_IsCgroupV2_Call
func (*ManagerMock_IsCgroupV2_Call) Run ¶
func (_c *ManagerMock_IsCgroupV2_Call) Run(run func()) *ManagerMock_IsCgroupV2_Call
func (*ManagerMock_IsCgroupV2_Call) RunAndReturn ¶
func (_c *ManagerMock_IsCgroupV2_Call) RunAndReturn(run func() bool) *ManagerMock_IsCgroupV2_Call
type ManagerMock_Join_Call ¶
ManagerMock_Join_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Join'
func (*ManagerMock_Join_Call) Return ¶
func (_c *ManagerMock_Join_Call) Return(_a0 error) *ManagerMock_Join_Call
func (*ManagerMock_Join_Call) Run ¶
func (_c *ManagerMock_Join_Call) Run(run func(pid int)) *ManagerMock_Join_Call
func (*ManagerMock_Join_Call) RunAndReturn ¶
func (_c *ManagerMock_Join_Call) RunAndReturn(run func(int) error) *ManagerMock_Join_Call
type ManagerMock_ReadCPUSet_Call ¶
ManagerMock_ReadCPUSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadCPUSet'
func (*ManagerMock_ReadCPUSet_Call) Return ¶
func (_c *ManagerMock_ReadCPUSet_Call) Return(_a0 cpuset.CPUSet, _a1 error) *ManagerMock_ReadCPUSet_Call
func (*ManagerMock_ReadCPUSet_Call) Run ¶
func (_c *ManagerMock_ReadCPUSet_Call) Run(run func()) *ManagerMock_ReadCPUSet_Call
func (*ManagerMock_ReadCPUSet_Call) RunAndReturn ¶
func (_c *ManagerMock_ReadCPUSet_Call) RunAndReturn(run func() (cpuset.CPUSet, error)) *ManagerMock_ReadCPUSet_Call
type ManagerMock_Read_Call ¶
ManagerMock_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
func (*ManagerMock_Read_Call) Return ¶
func (_c *ManagerMock_Read_Call) Return(_a0 string, _a1 error) *ManagerMock_Read_Call
func (*ManagerMock_Read_Call) Run ¶
func (_c *ManagerMock_Read_Call) Run(run func(controller string, file string)) *ManagerMock_Read_Call
func (*ManagerMock_Read_Call) RunAndReturn ¶
func (_c *ManagerMock_Read_Call) RunAndReturn(run func(string, string) (string, error)) *ManagerMock_Read_Call
type ManagerMock_RelativePath_Call ¶
ManagerMock_RelativePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RelativePath'
func (*ManagerMock_RelativePath_Call) Return ¶
func (_c *ManagerMock_RelativePath_Call) Return(_a0 string) *ManagerMock_RelativePath_Call
func (*ManagerMock_RelativePath_Call) Run ¶
func (_c *ManagerMock_RelativePath_Call) Run(run func(controller string)) *ManagerMock_RelativePath_Call
func (*ManagerMock_RelativePath_Call) RunAndReturn ¶
func (_c *ManagerMock_RelativePath_Call) RunAndReturn(run func(string) string) *ManagerMock_RelativePath_Call
type ManagerMock_Write_Call ¶
ManagerMock_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
func (*ManagerMock_Write_Call) Return ¶
func (_c *ManagerMock_Write_Call) Return(_a0 error) *ManagerMock_Write_Call
func (*ManagerMock_Write_Call) Run ¶
func (_c *ManagerMock_Write_Call) Run(run func(controller string, file string, data string)) *ManagerMock_Write_Call
func (*ManagerMock_Write_Call) RunAndReturn ¶
func (_c *ManagerMock_Write_Call) RunAndReturn(run func(string, string, string) error) *ManagerMock_Write_Call