metrics

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CPIField = "cpi_field"

	Cycles       = "cycles"
	Instructions = "instructions"
)
View Source
const (
	KoordletSubsystem = "koordlet"

	NodeKey = "node"

	StatusKey     = "status"
	StatusSucceed = "succeed"
	StatusFailed  = "failed"

	EvictionReasonKey = "reason"
	BESuppressTypeKey = "type"

	ContainerID   = "container_id"
	ContainerName = "container_name"

	PodUID       = "pod_uid"
	PodName      = "pod_name"
	PodNamespace = "pod_namespace"
)
View Source
const (
	PSIDegree       = "psi_degree"
	PSIPrecision    = "psi_precision"
	PSIResourceType = "psi_resource_type"

	CPUFullSupported = "cpu_full_supported"
)
View Source
const (
	ResourceTypeCPU = "cpu"
	ResourceTypeMem = "mem"
	ResourceTypeIO  = "io"

	Precision10  = "avg10"
	Precision60  = "avg60"
	Precision300 = "avg300"

	DegreeSome = "some"
	DegreeFull = "full"
)

Variables

View Source
var (
	KoordletStartTime = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: KoordletSubsystem,
		Name:      "start_time",
		Help:      "the start time of koordlet",
	}, []string{NodeKey})
	CollectNodeCPUInfoStatus = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: KoordletSubsystem,
		Name:      "collect_node_cpu_info_status",
		Help:      "the count of CollectNodeCPUInfo status",
	}, []string{NodeKey, StatusKey})

	PodEviction = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: KoordletSubsystem,
		Name:      "pod_eviction",
		Help:      "Number of eviction launched by koordlet",
	}, []string{NodeKey, EvictionReasonKey})

	BESuppressCPU = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: KoordletSubsystem,
		Name:      "be_suppress_cpu_cores",
		Help:      "Number of cores suppress by koordlet",
	}, []string{NodeKey, BESuppressTypeKey})

	CommonCollectors = []prometheus.Collector{
		KoordletStartTime,
		CollectNodeCPUInfoStatus,
		PodEviction,
		BESuppressCPU,
	}
)
View Source
var (
	ContainerCPI = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: KoordletSubsystem,
		Name:      "container_cpi",
		Help:      "Container cpi collected by koordlet",
	}, []string{NodeKey, ContainerID, ContainerName, PodUID, PodName, PodNamespace, CPIField})

	CPICollectors = []prometheus.Collector{
		ContainerCPI,
	}
)
View Source
var (
	NodeName string
	Node     *corev1.Node
)
View Source
var (
	ContainerPSI = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: KoordletSubsystem,
		Name:      "container_psi",
		Help:      "Container psi collected by koordlet",
	}, []string{NodeKey, ContainerID, ContainerName, PodUID, PodName, PodNamespace, PSIResourceType, PSIPrecision, PSIDegree, CPUFullSupported})

	PodPSI = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Subsystem: KoordletSubsystem,
		Name:      "pod_psi",
		Help:      "Pod psi collected by koordlet",
	}, []string{NodeKey, PodUID, PodName, PodNamespace, PSIResourceType, PSIPrecision, PSIDegree, CPUFullSupported})

	PSICollectors = []prometheus.Collector{
		ContainerPSI,
		PodPSI,
	}
)

Functions

func RecordBESuppressCores

func RecordBESuppressCores(suppressType string, value float64)

func RecordCollectNodeCPUInfoStatus

func RecordCollectNodeCPUInfoStatus(err error)

func RecordContainerCPI added in v1.1.0

func RecordContainerCPI(status *corev1.ContainerStatus, pod *corev1.Pod, cycles, instructions float64)

func RecordContainerPSI added in v1.1.0

func RecordContainerPSI(status *corev1.ContainerStatus, pod *corev1.Pod, psi *util.PSIByResource)

func RecordKoordletStartTime

func RecordKoordletStartTime(nodeName string, value float64)

func RecordPodEviction

func RecordPodEviction(reasonType string)

func RecordPodPSI added in v1.1.0

func RecordPodPSI(pod *corev1.Pod, psi *util.PSIByResource)

func Register

func Register(node *corev1.Node)

Register registers the metrics with the node object

func ResetContainerCPI added in v1.1.0

func ResetContainerCPI()

func ResetContainerPSI added in v1.1.0

func ResetContainerPSI()

func ResetPodPSI added in v1.1.0

func ResetPodPSI()

Types

type PSIRecord added in v1.1.0

type PSIRecord struct {
	ResourceType     string
	Precision        string
	Degree           string
	Value            float64
	CPUFullSupported bool
}

Jump to

Keyboard shortcuts

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