fscommon

package
v1.0.0-rc90 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 9 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")
)

Functions

func GetCgroupParamKeyValue

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

Parses a cgroup param and returns as name, value

i.e. "io_service_bytes 1234" will return as io_service_bytes, 1234

func GetCgroupParamString

func GetCgroupParamString(cgroupPath, cgroupFile string) (string, error)

Gets a string value from the specified cgroup file

func GetCgroupParamUint

func GetCgroupParamUint(cgroupPath, cgroupFile string) (uint64, error)

Gets a single uint64 value from the specified cgroup file.

func ParseUint

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

Saturates negative values at zero and returns a uint64. Due to kernel bugs, some of the memory cgroup stats can be negative.

func ReadFile

func ReadFile(dir, file string) (string, error)

func WriteFile

func WriteFile(dir, file, data string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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