Documentation ¶
Index ¶
- Constants
- func Get(root string) (*infov1.MachineInfo, error)
- func GetRaw(root string) (*infov1.MachineInfo, error)
- func NewRelocatableSysFs(root string) sysfs.SysFs
- type Handle
- type RelocatableSysFs
- func (fs RelocatableSysFs) GetBlockDeviceNumbers(name string) (string, error)
- func (fs RelocatableSysFs) GetBlockDeviceScheduler(name string) (string, error)
- func (fs RelocatableSysFs) GetBlockDeviceSize(name string) (string, error)
- func (fs RelocatableSysFs) GetBlockDevices() ([]os.FileInfo, error)
- func (fs RelocatableSysFs) GetCPUPhysicalPackageID(cpuPath string) (string, error)
- func (fs RelocatableSysFs) GetCPUsPaths(cpusPath string) ([]string, error)
- func (fs RelocatableSysFs) GetCacheInfo(id int, name string) (sysfs.CacheInfo, error)
- func (fs RelocatableSysFs) GetCaches(id int) ([]os.FileInfo, error)
- func (fs RelocatableSysFs) GetCoreID(cpuPath string) (string, error)
- func (fs RelocatableSysFs) GetDistances(nodePath string) (string, error)
- func (fs RelocatableSysFs) GetHugePagesInfo(hugePagesDirectory string) ([]os.FileInfo, error)
- func (fs RelocatableSysFs) GetHugePagesNr(hugepagesDirectory string, hugePageName string) (string, error)
- func (fs RelocatableSysFs) GetMemInfo(nodePath string) (string, error)
- func (fs RelocatableSysFs) GetNetworkAddress(name string) (string, error)
- func (fs RelocatableSysFs) GetNetworkDevices() ([]os.FileInfo, error)
- func (fs RelocatableSysFs) GetNetworkMtu(name string) (string, error)
- func (fs RelocatableSysFs) GetNetworkSpeed(name string) (string, error)
- func (fs RelocatableSysFs) GetNetworkStatValue(dev string, stat string) (uint64, error)
- func (fs RelocatableSysFs) GetNodesPaths() ([]string, error)
- func (fs RelocatableSysFs) GetSystemUUID() (string, error)
- func (fs RelocatableSysFs) IsBlockDeviceHidden(name string) (bool, error)
- func (fs RelocatableSysFs) IsCPUOnline(cpuPath string) bool
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 NewRelocatableSysFs ¶
Types ¶
type Handle ¶
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 (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
Click to show internal directories.
Click to hide internal directories.