collector

package
v0.4.2 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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The energy stat metrics are meat to be only used by the model server for training purpose
	// These metris report the following labels, we have the full list here to make it more transparent
	// TODO: review these metrics, they might be deprecated
	NodeMetricsStatLabels = []string{
		"node_name",
		"cpu_architecture",
		"node_curr_cpu_time",
		"node_curr_cpu_cycles",
		"node_curr_cpu_instr",
		"node_curr_cache_miss",
		"node_curr_container_cpu_usage_seconds_total",
		"node_curr_container_memory_working_set_bytes",
		"node_curr_bytes_read",
		"node_curr_bytes_writes",
		"node_block_devices_used",
		"node_curr_energy_in_core_joule",
		"node_curr_energy_in_dram_joule",
		"node_curr_energy_in_gpu_joule",
		"node_curr_energy_in_other_joule",
		"node_curr_energy_in_pkg_joule",
		"node_curr_energy_in_uncore_joule"}
)

Functions

This section is empty.

Types

type Collector

type Collector struct {

	// NodeMetrics holds all node energy and resource usage metrics
	NodeMetrics collector_metric.NodeMetrics

	// ContainersMetrics holds all container energy and resource usage metrics
	ContainersMetrics map[string]*collector_metric.ContainerMetrics

	// ProcessMetrics hold all process energy and resource usage metrics
	ProcessMetrics map[uint64]*collector_metric.ProcessMetrics
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector() *Collector

func (*Collector) Destroy

func (c *Collector) Destroy()

func (*Collector) Initialize

func (c *Collector) Initialize() error

func (*Collector) Update

func (c *Collector) Update()

Update updates the node and container energy and resource usage metrics

type ContainerDesc

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

type NodeDesc

type NodeDesc struct {

	// Additional metrics (gauge)
	// TODO: review if we really need to expose this metric.
	NodeCPUFrequency *prometheus.Desc

	// the NodeMetricsStat does not follow the prometheus metrics standard guideline, and this is only used by the model server.
	NodeMetricsStat *prometheus.Desc
	// contains filtered or unexported fields
}

type PodDesc

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

metric used by the model server to train the model

type ProcessBPFMetrics

type ProcessBPFMetrics struct {
	CGroupID       uint64
	PID            uint64
	ProcessRunTime uint64
	CPUCycles      uint64
	CPUInstr       uint64
	CacheMisses    uint64
	VecNR          [config.MaxIRQ]uint16 // irq counter, 10 is the max number of irq vectors
	Command        [16]byte
}

TODO in sync with bpf program

type PrometheusCollector

type PrometheusCollector struct {

	// TODO: fix me: these metrics should be in NodeMetrics structure
	NodeCPUFrequency *map[int32]uint64

	// NodeMetrics holds all node energy and resource usage metrics
	NodeMetrics *collector_metric.NodeMetrics

	// ContainersMetrics holds all container energy and resource usage metrics
	ContainersMetrics *map[string]*collector_metric.ContainerMetrics

	// ProcessMetrics hold all process energy and resource usage metrics
	ProcessMetrics *map[uint64]*collector_metric.ProcessMetrics

	// SamplePeriodSec the collector metric collection interval
	SamplePeriodSec float64

	// Lock to syncronize the collector update with prometheus exporter
	Mx sync.Mutex

	// Record whether we have KubletMetrics
	HaveKubletMetric bool

	// Record whether we have cGroupsMetrics
	HavecGroupsMetric bool
	// contains filtered or unexported fields
}

PrometheusCollector holds the list of prometheus metrics for both node and pod context

func NewPrometheusExporter

func NewPrometheusExporter() *PrometheusCollector

NewPrometheusExporter create and initialize all the PrometheusCollector structures

func (*PrometheusCollector) Collect

func (p *PrometheusCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface

func (*PrometheusCollector) Describe

func (p *PrometheusCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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