fscommon

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotValidFormat = errors.New("line is not a valid key value format")

	OpenFile  = cgroups.OpenFile
	ReadFile  = cgroups.ReadFile
	WriteFile = cgroups.WriteFile
	CopyFile  = cgroups.CopyFile
)

Functions

func GetCgroupParamInt

func GetCgroupParamInt(path, file string) (int64, error)

GetCgroupParamInt reads a single int64 value from specified cgroup file. If the value read is "max", the math.MaxInt64 is returned.

func GetCgroupParamKeyValue

func GetCgroupParamKeyValue(t string) (string, uint64, error)

GetCgroupParamKeyValue parses a space-separated "name value" kind of cgroup parameter and returns its components. For example, "io_service_bytes 1234" will return as "io_service_bytes", 1234.

func GetCgroupParamString

func GetCgroupParamString(path, file string) (string, error)

GetCgroupParamString reads a string from the specified cgroup file.

func GetCgroupParamUint

func GetCgroupParamUint(path, file string) (uint64, error)

GetCgroupParamUint reads a single uint64 value from the specified cgroup file. If the value read is "max", the math.MaxUint64 is returned.

func ParseUint

func ParseUint(s string, base, bitSize int) (uint64, error)

ParseUint converts a string to an uint64 integer. Negative values are returned at zero as, due to kernel bugs, some of the memory cgroup stats can be negative.

func RdmaGetStats

func RdmaGetStats(path string, stats *cgroups.Stats) error

RdmaGetStats returns rdma stats such as totalLimit and current entries.

func RdmaSet

func RdmaSet(path string, cgroup *configs.Cgroup) error

RdmaSet sets RDMA resources.

Types

This section is empty.

Jump to

Keyboard shortcuts

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