Documentation
¶
Index ¶
Constants ¶
View Source
const ProcVersionPath string = "/proc/version"
Variables ¶
View Source
var ReleaseUnkonwErr = errors.New("Unkonw linux release")
Functions ¶
This section is empty.
Types ¶
type CHelper ¶
type CHelper struct { ContainerHelper KClient *kubernetes.Clientset PraseFunc ProcPraseFunc }
CHelper Get container or pod information
func NewCHepler ¶
func NewCHepler(ops *CHelperOps) *CHelper
func (*CHelper) GetContainers ¶
TODO: Implement Get Containers
func (*CHelper) GetK8sPods ¶
func (c *CHelper) GetK8sPods(processesInfo []*nvml.ProcessInfo) ([]*PodGPUInfo, error)
type CHelperOps ¶
type CHelperOps struct { KClient *kubernetes.Clientset PraseFunc ProcPraseFunc }
type ContainerHelper ¶
type ContainerHelper interface { GetContainers(processInfo []*nvml.ProcessInfo) ([]*types.Container, error) GetK8sPods(processInfo []*nvml.ProcessInfo) ([]*PodGPUInfo, error) }
type Phelper ¶
type Phelper struct { ProcHelper // contains filtered or unexported fields }
Phelper Register ProcPraseFunc and prase process's pid
func NewPhelper ¶
func NewPhelper(pid uint, opt PhelperOpts) *Phelper
func (*Phelper) PraseProc ¶
func (p *Phelper) PraseProc() (PidPraseOut, error)
type PhelperOpts ¶
type PhelperOpts struct {
PraseFunc ProcPraseFunc
}
type PidBindDocker ¶
type PidBindDocker struct {
// contains filtered or unexported fields
}
func (*PidBindDocker) GetDockerUid ¶
func (o *PidBindDocker) GetDockerUid() (string, error)
func (*PidBindDocker) GetPodUid ¶
func (o *PidBindDocker) GetPodUid() (string, error)
func (*PidBindDocker) SetDockerUid ¶
func (o *PidBindDocker) SetDockerUid(uid string) error
func (*PidBindDocker) SetPodUid ¶
func (o *PidBindDocker) SetPodUid(uid string) error
type PidBindK8sPod ¶
type PidBindK8sPod struct {
// contains filtered or unexported fields
}
PidBindK8sPod Parse output vector
func (*PidBindK8sPod) GetDockerUid ¶
func (o *PidBindK8sPod) GetDockerUid() (string, error)
func (*PidBindK8sPod) GetPodUid ¶
func (o *PidBindK8sPod) GetPodUid() (string, error)
func (*PidBindK8sPod) SetDockerUid ¶
func (o *PidBindK8sPod) SetDockerUid(uid string) error
func (*PidBindK8sPod) SetPodUid ¶
func (o *PidBindK8sPod) SetPodUid(uid string) error
type PidPraseOut ¶
type PidPraseOut interface { GetPodUid() (string, error) GetDockerUid() (string, error) SetPodUid(uid string) error SetDockerUid(uid string) error }
func DefaultProcPraserFunc ¶
func DefaultProcPraserFunc(procInfo string) (PidPraseOut, error)
type PodGPUInfo ¶
type PodGPUInfo struct { Pod v1.Pod ProcessInfo *nvml.ProcessInfo }
type ProcHelper ¶
type ProcHelper interface {
PraseProc() (PidPraseOut, error)
}
type ProcPraseFunc ¶
type ProcPraseFunc func(procInfo string) (PidPraseOut, error)
ProcPraseFunc to prase the /proc/{pid}/cpuset
func (ProcPraseFunc) Prase ¶
func (p ProcPraseFunc) Prase(procInfo string) (PidPraseOut, error)
type ProcPraser ¶
type ProcPraser interface {
Prase() error
}
Click to show internal directories.
Click to hide internal directories.