utils

package
v0.0.0-...-e5e0983 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(t PidType) error

Create a new sched core domain

func CreateVmmUser

func CreateVmmUser() (string, error)

CreateVmmUser create a temp user for running Kata Containers under rootless mode.

func EnsureDir

func EnsureDir(path string, mode os.FileMode) error

EnsureDir check if a directory exist, if not then create it

func FirstValidExecutable

func FirstValidExecutable(paths []string) (string, error)

func GzipAccepted

func GzipAccepted(header http.Header) bool

GzipAccepted returns whether the client will accept gzip-encoded content.

func RemoveVmmUser

func RemoveVmmUser(user string) error

RemoveVmmUser delete user created by CreateVmmUser.

func RunCommand

func RunCommand(args []string) (string, error)

RunCommand returns the commands space-trimmed standard output on success

func RunCommandFull

func RunCommandFull(args []string, includeStderr bool) (string, error)

RunCommandFull returns the commands space-trimmed standard output and error on success. Note that if the command fails, the requested output will still be returned, along with an error.

func SetGaugeVecNetDev

func SetGaugeVecNetDev(gv *prometheus.GaugeVec, v procfs.NetDevLine)

SetGaugeVecNetDev set gauge for NetDevLine

func SetGaugeVecProcIO

func SetGaugeVecProcIO(gv *prometheus.GaugeVec, ioStat procfs.ProcIO)

SetGaugeVecProcIO set gauge for ProcIO

func SetGaugeVecProcStat

func SetGaugeVecProcStat(gv *prometheus.GaugeVec, procStat procfs.ProcStat)

SetGaugeVecProcStat set gauge for ProcStat

func SetGaugeVecProcStatus

func SetGaugeVecProcStatus(gv *prometheus.GaugeVec, procStatus procfs.ProcStatus)

SetGaugeVecProcStatus set gauge for ProcStatus

func ShareFrom

func ShareFrom(pid uint64, t PidType) error

ShareFrom shares the sched core domain from the provided pid

func String2Pointer

func String2Pointer(s string) *string

String2Pointer make a string to a pointer to string

Types

type PidType

type PidType int

PidType is the type of provided pid value and how it should be treated

const (

	// Pid affects the current pid
	Pid PidType = pidTypePid
	// ThreadGroup affects all threads in the group
	ThreadGroup PidType = pidTypeThreadGroupId
	// ProcessGroup affects all processes in the group
	ProcessGroup PidType = pidTypeProcessGroupId
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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