machineinformer

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const (

	// CPUPhysicalPackageID is a physical package id of cpu#. Typically corresponds to a physical socket number,
	// but the actual value is architecture and platform dependent.
	CPUPhysicalPackageID = "physical_package_id"
	// CPUCoreID is the CPU core ID of cpu#. Typically it is the hardware platform's identifier
	// (rather than the kernel's). The actual value is architecture and platform dependent.
	CPUCoreID = "core_id"

	//HugePagesNrFile name of nr_hugepages file in sysfs
	HugePagesNrFile = "nr_hugepages"
)

Variables

This section is empty.

Functions

func Get

func Get(root string) (*infov1.MachineInfo, error)

func GetRaw

func GetRaw(root string) (*infov1.MachineInfo, error)

func NewRelocatableSysFs

func NewRelocatableSysFs(root string) sysfs.SysFs

Types

type Handle

type Handle struct {
	RootDirectory   string
	RawOutput       bool
	CleanTimestamp  bool
	CleanProcfsInfo bool
	Out             io.Writer
}

func (*Handle) Run

func (handle *Handle) Run()

type RelocatableSysFs

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

RelocatableSysFs allows to consume a sysfs tree whose root is not `/sys`. this means we can easily consume a syfs snapshot from another node, for troubleshoot and debugging purposes, without complex/cumbersome chroot dances or even more complicated, without containerizing the test session. the cadvisor's SysFS interface is not formalized nor very clean, so we add the prefix in few key place discovered using tests and reviewing how the API is used.

func (RelocatableSysFs) GetBlockDeviceNumbers

func (fs RelocatableSysFs) GetBlockDeviceNumbers(name string) (string, error)

func (RelocatableSysFs) GetBlockDeviceScheduler

func (fs RelocatableSysFs) GetBlockDeviceScheduler(name string) (string, error)

func (RelocatableSysFs) GetBlockDeviceSize

func (fs RelocatableSysFs) GetBlockDeviceSize(name string) (string, error)

func (RelocatableSysFs) GetBlockDevices

func (fs RelocatableSysFs) GetBlockDevices() ([]os.FileInfo, error)

func (RelocatableSysFs) GetCPUPhysicalPackageID

func (fs RelocatableSysFs) GetCPUPhysicalPackageID(cpuPath string) (string, error)

func (RelocatableSysFs) GetCPUsPaths

func (fs RelocatableSysFs) GetCPUsPaths(cpusPath string) ([]string, error)

func (RelocatableSysFs) GetCacheInfo

func (fs RelocatableSysFs) GetCacheInfo(id int, name string) (sysfs.CacheInfo, error)

func (RelocatableSysFs) GetCaches

func (fs RelocatableSysFs) GetCaches(id int) ([]os.FileInfo, error)

func (RelocatableSysFs) GetCoreID

func (fs RelocatableSysFs) GetCoreID(cpuPath string) (string, error)

func (RelocatableSysFs) GetDistances added in v0.1.11

func (fs RelocatableSysFs) GetDistances(nodePath string) (string, error)

func (RelocatableSysFs) GetHugePagesInfo

func (fs RelocatableSysFs) GetHugePagesInfo(hugePagesDirectory string) ([]os.FileInfo, error)

func (RelocatableSysFs) GetHugePagesNr

func (fs RelocatableSysFs) GetHugePagesNr(hugepagesDirectory string, hugePageName string) (string, error)

func (RelocatableSysFs) GetMemInfo

func (fs RelocatableSysFs) GetMemInfo(nodePath string) (string, error)

func (RelocatableSysFs) GetNetworkAddress

func (fs RelocatableSysFs) GetNetworkAddress(name string) (string, error)

func (RelocatableSysFs) GetNetworkDevices

func (fs RelocatableSysFs) GetNetworkDevices() ([]os.FileInfo, error)

func (RelocatableSysFs) GetNetworkMtu

func (fs RelocatableSysFs) GetNetworkMtu(name string) (string, error)

func (RelocatableSysFs) GetNetworkSpeed

func (fs RelocatableSysFs) GetNetworkSpeed(name string) (string, error)

func (RelocatableSysFs) GetNetworkStatValue

func (fs RelocatableSysFs) GetNetworkStatValue(dev string, stat string) (uint64, error)

func (RelocatableSysFs) GetNodesPaths

func (fs RelocatableSysFs) GetNodesPaths() ([]string, error)

func (RelocatableSysFs) GetSystemUUID

func (fs RelocatableSysFs) GetSystemUUID() (string, error)

func (RelocatableSysFs) IsBlockDeviceHidden added in v0.1.12

func (fs RelocatableSysFs) IsBlockDeviceHidden(name string) (bool, error)

See: https://github.com/google/cadvisor/blob/v0.48.1/utils/sysfs/sysfs.go#L218-L236

func (RelocatableSysFs) IsCPUOnline

func (fs RelocatableSysFs) IsCPUOnline(cpuPath string) bool

Jump to

Keyboard shortcuts

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