config

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// counter - attacher package
	CPUCycle       = "cpu_cycles"
	CPURefCycle    = "cpu_ref_cycles"
	CPUInstruction = "cpu_instr"
	CacheMiss      = "cache_miss"

	// bpf - attacher package
	CPUTime       = "cpu_time"
	IRQNetTXLabel = "irq_net_tx"
	IRQNetRXLabel = "irq_net_rx"
	IRQBlockLabel = "irq_block"

	// cgroup - cgroup package
	CgroupfsMemory       = "cgroupfs_memory_usage_bytes"
	CgroupfsKernelMemory = "cgroupfs_kernel_memory_usage_bytes"
	CgroupfsTCPMemory    = "cgroupfs_tcp_memory_usage_bytes"
	CgroupfsCPU          = "cgroupfs_cpu_usage_us"
	CgroupfsSystemCPU    = "cgroupfs_system_cpu_usage_us"
	CgroupfsUserCPU      = "cgroupfs_user_cpu_usage_us"
	CgroupfsReadIO       = "cgroupfs_ioread_bytes"
	CgroupfsWriteIO      = "cgroupfs_iowrite_bytes"
	BytesReadIO          = "bytes_read"
	BytesWriteIO         = "bytes_writes"
	BlockDevicesIO       = "block_devices_used"
	// kubelet - package
	KubeletContainerCPU    = "container_cpu_usage_seconds_total"
	KubeletContainerMemory = "container_memory_working_set_bytes"
	KubeletNodeCPU         = "node_cpu_usage_seconds_total"
	KubeletNodeMemory      = "node_memory_working_set_bytes"

	// system
	CPUFrequency = "avg_cpu_frequency"

	// GPU
	GPUSMUtilization  = "gpu_sm_util"
	GPUMemUtilization = "gpu_mem_util"
)
View Source
const (

	// MaxIRQ is the maximum number of IRQs to be monitored
	MaxIRQ = 10
)

Variables

View Source
var (
	EnabledMSR = false

	KeplerNamespace              = getConfig("KELPER_NAMESPACE", defaultNamespace)
	EnabledEBPFCgroupID          = getBoolConfig("ENABLE_EBPF_CGROUPID", true)
	EnabledGPU                   = getBoolConfig("ENABLE_GPU", false)
	EnableProcessMetrics         = getBoolConfig("ENABLE_PROCESS_METRICS", false)
	ExposeHardwareCounterMetrics = getBoolConfig("EXPOSE_HW_COUNTER_METRICS", true)
	ExposeCgroupMetrics          = getBoolConfig("EXPOSE_CGROUP_METRICS", true)
	ExposeKubeletMetrics         = getBoolConfig("EXPOSE_KUBELET_METRICS", true)
	ExposeIRQCounterMetrics      = getBoolConfig("EXPOSE_IRQ_COUNTER_METRICS", true)
	MetricPathKey                = "METRIC_PATH"
	BindAddressKey               = "BIND_ADDRESS"
	CPUArchOverride              = getConfig("CPU_ARCH_OVERRIDE", "")

	EstimatorModel        = getConfig("ESTIMATOR_MODEL", defaultMetricValue)         // auto-select
	EstimatorSelectFilter = getConfig("ESTIMATOR_SELECT_FILTER", defaultMetricValue) // no filter
	CoreUsageMetric       = getConfig("CORE_USAGE_METRIC", CPUInstruction)
	DRAMUsageMetric       = getConfig("DRAM_USAGE_METRIC", CacheMiss)
	UncoreUsageMetric     = getConfig("UNCORE_USAGE_METRIC", defaultMetricValue) // no metric (evenly divided)
	GpuUsageMetric        = getConfig("GPU_USAGE_METRIC", GPUSMUtilization)      // no metric (evenly divided)
	GeneralUsageMetric    = getConfig("GENERAL_USAGE_METRIC", CPUInstruction)    // for uncategorized energy; pkg - core - uncore

	////////////////////////////////////
	ModelServerEnable   = getBoolConfig("MODEL_SERVER_ENABLE", false)
	ModelServerEndpoint = SetModelServerReqEndpoint()

	// model_item
	NodeTotalKey           = "NODE_TOTAL"
	NodeComponentsKey      = "NODE_COMPONENTS"
	ContainerTotalKey      = "CONTAINER_TOTAL"
	ContainerComponentsKey = "CONTAINER_COMPONENTS"
	ProcessTotalKey        = "PROCESS_TOTAL"
	ProcessComponentsKey   = "PROCESS_COMPONENTS"

	//  attribute
	EstimatorEnabledKey = "ESTIMATOR"
	InitModelURLKey     = "INIT_URL"
	FixedModelNameKey   = "MODEL"
	ModelFiltersKey     = "FILTERS"
)

Functions

func GetBindAddress

func GetBindAddress(cmdSet string) string

func GetCGroupVersion

func GetCGroupVersion() int

Get cgroup version, return 1 or 2

func GetMetricPath

func GetMetricPath(cmdSet string) string

func GetModelConfig

func GetModelConfig(modelItem string) (useEstimatorSidecar bool, selectedModel, selectFilter, initModelURL string)

func InitModelConfigMap

func InitModelConfigMap()

InitModelConfigMap initializes map of config from MODEL_CONFIG

func LogConfigs

func LogConfigs()

func SetEnabledEBPFCgroupID

func SetEnabledEBPFCgroupID(enabled bool)

SetEnabledEBPFCgroupID enables the eBPF code to collect cgroup id if the system has kernel version > 4.18

func SetEnabledGPU

func SetEnabledGPU(enabled bool)

SetEnabledGPU enables the exposure of gpu metrics

func SetEnabledHardwareCounterMetrics

func SetEnabledHardwareCounterMetrics(enabled bool)

SetEnabledHardwareCounterMetrics enables the exposure of hardware counter metrics

func SetEstimatorConfig

func SetEstimatorConfig(modelName, selectFilter string)

func SetModelServerEndpoint

func SetModelServerEndpoint(serverEndpoint string)

func SetModelServerReqEndpoint

func SetModelServerReqEndpoint() (modelServerReqEndpoint string)

Types

type Client

type Client interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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