metrics

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerDeviceProcInfoFunc

func ContainerDeviceProcInfoFunc(procInfos procInfoList,
	containerPids []uint32, f func(nvml.ProcessInfo_v1))

func ContainerDeviceProcUtilFunc

func ContainerDeviceProcUtilFunc(procUtils procUtilList,
	containerPids []uint32, f func(nvml.ProcessUtilizationSample))

func ContainerPidsFunc

func ContainerPidsFunc(pod *corev1.Pod, containerName string, fullPath func(string) string, f func(pid int))

func FlattenDevicesFunc

func FlattenDevicesFunc(podDevices device.PodDevices, f func(claimDevice device.ClaimDevice))

func GetNodeInformer

func GetNodeInformer(factory informers.SharedInformerFactory, nodeName string) cache.SharedIndexInformer

func GetPodInformer

func GetPodInformer(factory informers.SharedInformerFactory, nodeName string) cache.SharedIndexInformer

func NewServer

func NewServer(registry *prometheus.Registry, port int) *server

Types

type CollectorService

type CollectorService interface {
	prometheus.Collector
	Registry() *prometheus.Registry
}

func NewNodeGPUCollector

func NewNodeGPUCollector(nodeName string, nodeLister listerv1.NodeLister,
	podLister listerv1.PodLister, contLister *ContainerLister) (CollectorService, error)

type ContainerKey

type ContainerKey string

func GetContainerKey

func GetContainerKey(uid types.UID, containerName string) ContainerKey

func (ContainerKey) SpiltUIDAndContainerName

func (key ContainerKey) SpiltUIDAndContainerName() (types.UID, string)

type ContainerLister

type ContainerLister struct {
	// contains filtered or unexported fields
}

func NewContainerLister

func NewContainerLister(basePath, nodeName string, podLister listerv1.PodLister) *ContainerLister

func (*ContainerLister) GetResourceData

func (c *ContainerLister) GetResourceData(key ContainerKey) (*vgpu.ResourceDataT, bool)

func (*ContainerLister) Start

func (c *ContainerLister) Start(interval time.Duration, stopChan <-chan struct{})

type ResourceConfig

type ResourceConfig struct {
	DataBytes    []byte
	ResourceData *vgpu.ResourceDataT
}

Jump to

Keyboard shortcuts

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