Documentation
¶
Index ¶
- Variables
- func GetCgroupParamInt(path, file string) (int64, error)
- func GetCgroupParamKeyValue(t string) (string, uint64, error)
- func GetCgroupParamString(path, file string) (string, error)
- func GetCgroupParamUint(path, file string) (uint64, error)
- func OpenFile(dir, file string, flags int) (*os.File, error)
- func ParseUint(s string, base, bitSize int) (uint64, error)
- func ReadFile(dir, file string) (string, error)
- func WriteFile(dir, file, data string) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotValidFormat = errors.New("line is not a valid key value format")
)
var ( // Set to true by fs unit tests TestMode bool )
Functions ¶
func GetCgroupParamInt ¶
GetCgroupParamInt reads a single int64 value from specified cgroup file. If the value read is "max", the math.MaxInt64 is returned.
func GetCgroupParamKeyValue ¶
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 ¶
GetCgroupParamString reads a string from the specified cgroup file.
func GetCgroupParamUint ¶
GetCgroupParamUint reads a single uint64 value from the specified cgroup file. If the value read is "max", the math.MaxUint64 is returned.
func OpenFile ¶
OpenFile opens a cgroup file in a given dir with given flags. It is supposed to be used for cgroup files only.
func ParseUint ¶
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.
Types ¶
This section is empty.