types

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RodanServerPort = 9102

	NodeMemoryPath       = "/node/memory"
	NodeCgroupMemoryPath = "/node/qosgroupmem"

	NumaMemoryPath = "/node/numastat"

	NodeCPUPath    = "/node/nodecpu"
	NodeSysctlPath = "/node/sysctl"

	ContainerCPUPath          = "/container/cgcpu"
	ContainerCgroupMemoryPath = "/container/cgmem"
	ContainerNumaStatPath     = "/container/cgnumastat"
	ContainerLoadPath         = "/container/loadavg"
	ContainerCghardwarePath   = "/container/cghardware"
)

Variables

View Source
var MetricsMap = map[string]map[string]string{
	NodeMemoryPath: {
		"memory_memtotal":       consts.MetricMemTotalSystem,
		"memory_memfree":        consts.MetricMemFreeSystem,
		"memory_memused":        consts.MetricMemUsedSystem,
		"memory_cached":         consts.MetricMemPageCacheSystem,
		"memory_buffers":        consts.MetricMemBufferSystem,
		"memory_pgsteal_kswapd": consts.MetricMemKswapdstealSystem,
	},
	NodeCgroupMemoryPath: {
		"qosgroupmem_besteffort_memory_rss":   consts.MetricMemRssCgroup,
		"qosgroupmem_besteffort_memory_usage": consts.MetricMemUsageCgroup,
		"qosgroupmem_burstable_memory_rss":    consts.MetricMemRssCgroup,
		"qosgroupmem_burstable_memory_usage":  consts.MetricMemUsageCgroup,
	},
	NumaMemoryPath: {
		"memtotal": consts.MetricMemTotalNuma,
		"memfree":  consts.MetricMemFreeNuma,
	},
	NodeCPUPath: {
		"usage":      consts.MetricCPUUsageRatio,
		"sched_wait": consts.MetricCPUSchedwait,
	},
	NodeSysctlPath: {
		"sysctl_vm_watermark_scale_factor": consts.MetricMemScaleFactorSystem,
	},
	ContainerCPUPath: {
		"cgcpu_usage": consts.MetricCPUUsageContainer,
	},
	ContainerCgroupMemoryPath: {
		"cgmem_total_shmem": consts.MetricMemShmemContainer,
		"cgmem_total_rss":   consts.MetricMemRssContainer,
		"cgmem_total_cache": consts.MetricMemCacheContainer,
	},
	ContainerLoadPath: {
		"loadavg_nrrunning": consts.MetricCPUNrRunnableContainer,
		"loadavg_loadavg1":  consts.MetricLoad1MinContainer,
		"loadavg_loadavg5":  consts.MetricLoad5MinContainer,
		"loadavg_loadavg15": consts.MetricLoad15MinContainer,
	},
	ContainerNumaStatPath: {
		"filepage": consts.MetricsMemFilePerNumaContainer,
	},
	ContainerCghardwarePath: {
		"cghardware_cycles":       consts.MetricCPUCyclesContainer,
		"cghardware_instructions": consts.MetricCPUInstructionsContainer,
	},
}

read only

Functions

func ParseCorestatKey

func ParseCorestatKey(key string) (int, string, error)

func ParseNumastatKey

func ParseNumastatKey(key string) (int, string, error)

key: numastat_{nodeNum}_{metricName}, eg, numastat_node0_memtotal return numaNode, metricName, error

Types

type Cell

type Cell struct {
	Key string  `json:"key"`
	Val float64 `json:"val"`
}

Cell is the basic unit of the indicator

type CellList

type CellList struct {
	Data []Cell `json:"data"`
}

type ContainerResponse

type ContainerResponse struct {
	Data map[string][]Cell `json:"data"`
}

type CoreCPUResponse

type CoreCPUResponse CellList

type NUMAMemoryResponse

type NUMAMemoryResponse CellList

type NodeCgroupMemoryResponse

type NodeCgroupMemoryResponse CellList

type NodeMemoryResponse

type NodeMemoryResponse CellList

type NodeSysctlResponse

type NodeSysctlResponse CellList

Jump to

Keyboard shortcuts

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