cgroup

package
v0.0.0-...-9d1fdd8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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 2024 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 2024 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 2024 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 2024 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 2024 Datadog, Inc.

Index

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

type ManagerMock struct {
	mock.Mock
}

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

func (*ManagerMock) Write

func (_m *ManagerMock) Write(controller string, file string, data string) error

Write provides a mock function with given fields: controller, file, data

type ManagerMock_Expecter

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

func (*ManagerMock_Expecter) IsCgroupV2

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

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

type ManagerMock_IsCgroupV2_Call struct {
	*mock.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 (*ManagerMock_IsCgroupV2_Call) Run

func (*ManagerMock_IsCgroupV2_Call) RunAndReturn

func (_c *ManagerMock_IsCgroupV2_Call) RunAndReturn(run func() bool) *ManagerMock_IsCgroupV2_Call

type ManagerMock_Join_Call

type ManagerMock_Join_Call struct {
	*mock.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 (*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

type ManagerMock_ReadCPUSet_Call struct {
	*mock.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 (*ManagerMock_ReadCPUSet_Call) Run

func (*ManagerMock_ReadCPUSet_Call) RunAndReturn

type ManagerMock_Read_Call

type ManagerMock_Read_Call struct {
	*mock.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 (*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

type ManagerMock_RelativePath_Call struct {
	*mock.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 (*ManagerMock_RelativePath_Call) Run

func (*ManagerMock_RelativePath_Call) RunAndReturn

type ManagerMock_Write_Call

type ManagerMock_Write_Call struct {
	*mock.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 (*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

Jump to

Keyboard shortcuts

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