Documentation ¶
Index ¶
- Variables
- func AddContainerIDToCache(pid uint64, containerID string)
- func DefaultConverter(stats map[string]interface{}, key string) interface{}
- func GetAliveContainers() (map[string]bool, error)
- func GetAvailableCgroupMetrics() []string
- func GetAvailableKubeletMetrics() []string
- func GetContainerID(cGroupID, pid uint64, withCGroupID bool) (string, error)
- func GetContainerIDFromPID(pid uint64) (string, error)
- func GetContainerMetrics() (containerCPU, containerMem map[string]float64, nodeCPU, nodeMem float64, ...)
- func GetContainerName(cGroupID, pid uint64, withCGroupID bool) (string, error)
- func GetPodName(cGroupID, pid uint64, withCGroupID bool) (string, error)
- func GetPodNameSpace(cGroupID, pid uint64, withCGroupID bool) (string, error)
- func GetStandardStat(containerID string) map[string]interface{}
- func HasCgroupExportMetric(availableMetrics []string) bool
- func Init() (*[]corev1.Pod, error)
- func NanoToMicroConverter(stats map[string]interface{}, key string) interface{}
- func ParseContainerIDFromPodStatus(containerID string) string
- func ReadAllCgroupIOStat() (rBytes, wBytes uint64, disks int, err error)
- func ReadCgroupIOStat(cGroupID, pid uint64) (rBytes, wBytes uint64, disks int, err error)
- func ReadKV(fileName string) (map[string]interface{}, error)
- func ReadLineKEqualToV(fileName string) (map[string]interface{}, error)
- func ReadUInt64(fileName string) (uint64, error)
- func SearchByContainerID(topFolder, containerID string) string
- func SearchBySuffix(topFolder, suffix string) string
- func SetSliceHandler()
- func TryInitStatReaders(containerID string)
- type CPUStatReader
- type CgroupFSReadMetric
- type ContainerInfo
- type IOStatReader
- type MemoryStatReader
- type SliceHandler
- func (s *SliceHandler) GetCPUTopPath() string
- func (s *SliceHandler) GetIOTopPath() string
- func (s *SliceHandler) GetMemoryTopPath() string
- func (s *SliceHandler) GetStatReaders() map[string][]StatReader
- func (s *SliceHandler) GetStats(containerID string) map[string]interface{}
- func (s *SliceHandler) Init()
- func (s *SliceHandler) SetStatReaders(containerID string, statReaders []StatReader)
- type StatReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( KubePodCGroupPath string = cGroupSlicePath(baseCGroupPath, kubepodSlice) SystemCGroupPath string = cGroupSlicePath(baseCGroupPath, systemSlice) )
View Source
var ExportMetrics = map[string]any{ config.CgroupfsCPU: nil, config.CgroupfsMemory: nil, config.CgroupfsSystemCPU: nil, config.CgroupfsUserCPU: nil, }
View Source
var MemUsageFiles = []string{
"memory.usage_in_bytes",
"memory.kmem.usage_in_bytes",
"memory.kmem.tcp.usage_in_bytes",
"memory.current",
}
Functions ¶
func AddContainerIDToCache ¶
AddContainerIDToCache add the container id to cache using the pid as the key
func DefaultConverter ¶
func GetAliveContainers ¶
GetAliveContainers returns alive pod map
func GetAvailableCgroupMetrics ¶
func GetAvailableCgroupMetrics() []string
func GetAvailableKubeletMetrics ¶
func GetAvailableKubeletMetrics() []string
func GetContainerIDFromPID ¶
GetContainerIDFromPID find the container ID using the process PID
func GetContainerMetrics ¶
func GetContainerName ¶
func GetPodNameSpace ¶
func GetStandardStat ¶
func HasCgroupExportMetric ¶
func NanoToMicroConverter ¶
func ReadAllCgroupIOStat ¶
func ReadCgroupIOStat ¶
func ReadLineKEqualToV ¶
func ReadUInt64 ¶
func SearchByContainerID ¶
func SearchBySuffix ¶
func SetSliceHandler ¶
func SetSliceHandler()
func TryInitStatReaders ¶
func TryInitStatReaders(containerID string)
Types ¶
type CPUStatReader ¶
type CPUStatReader struct {
Path string
}
func (CPUStatReader) Read ¶
func (s CPUStatReader) Read() map[string]interface{}
type CgroupFSReadMetric ¶
type ContainerInfo ¶
type IOStatReader ¶
type IOStatReader struct {
Path string
}
func (IOStatReader) Read ¶
func (s IOStatReader) Read() map[string]interface{}
type MemoryStatReader ¶
type MemoryStatReader struct {
Path string
}
func (MemoryStatReader) Read ¶
func (s MemoryStatReader) Read() map[string]interface{}
type SliceHandler ¶
type SliceHandler struct { CPUTopPath string MemoryTopPath string IOTopPath string // contains filtered or unexported fields }
var SliceHandlerInstance *SliceHandler
func InitSliceHandler ¶
func InitSliceHandler() *SliceHandler
func (*SliceHandler) GetCPUTopPath ¶
func (s *SliceHandler) GetCPUTopPath() string
func (*SliceHandler) GetIOTopPath ¶
func (s *SliceHandler) GetIOTopPath() string
func (*SliceHandler) GetMemoryTopPath ¶
func (s *SliceHandler) GetMemoryTopPath() string
func (*SliceHandler) GetStatReaders ¶
func (s *SliceHandler) GetStatReaders() map[string][]StatReader
func (*SliceHandler) GetStats ¶
func (s *SliceHandler) GetStats(containerID string) map[string]interface{}
func (*SliceHandler) Init ¶
func (s *SliceHandler) Init()
func (*SliceHandler) SetStatReaders ¶
func (s *SliceHandler) SetStatReaders(containerID string, statReaders []StatReader)
type StatReader ¶
type StatReader interface {
Read() map[string]interface{}
}
Click to show internal directories.
Click to hide internal directories.