Documentation ¶
Index ¶
- Constants
- func CPUSetFromIDSet(s idset.IDSet) cpuset.CPUSet
- func IDSetFromCPUSet(cset cpuset.CPUSet) idset.IDSet
- func ParseFileEntries(path string, values map[string]interface{}, pickFn PickEntryFn) error
- func SetSysRoot(path string)
- func SysRoot() string
- type CPU
- type CPUFreq
- type CPUPackage
- type Cache
- type CacheType
- type EPP
- type MemInfo
- type MemoryType
- type Node
- type PickEntryFn
- type System
Constants ¶
const ( M = (int64(1) << 20) G = (int64(1) << 30) T = (int64(1) << 40) )
unit multipliers
Variables ¶
This section is empty.
Functions ¶
func CPUSetFromIDSet ¶ added in v0.6.0
CPUSetFromIDSet returns a cpuset.CPUSet corresponding to an id set.
func IDSetFromCPUSet ¶ added in v0.6.0
IDSetFromCPUSet returns an id set corresponding to a cpuset.CPUSet.
func ParseFileEntries ¶
func ParseFileEntries(path string, values map[string]interface{}, pickFn PickEntryFn) error
ParseFileEntries parses a sysfs files for the given entries.
func SetSysRoot ¶ added in v0.8.0
func SetSysRoot(path string)
SetSysRoot sets the sys root directory.
Types ¶
type CPU ¶
type CPU interface { ID() idset.ID PackageID() idset.ID DieID() idset.ID NodeID() idset.ID CoreID() idset.ID ThreadCPUSet() cpuset.CPUSet BaseFrequency() uint64 FrequencyRange() CPUFreq EPP() EPP Online() bool Isolated() bool SetFrequencyLimits(min, max uint64) error SstClos() int }
CPU is a CPU core.
type CPUFreq ¶
type CPUFreq struct {
// contains filtered or unexported fields
}
CPUFreq is a CPU frequency scaling range
type CPUPackage ¶
type CPUPackage interface { ID() idset.ID CPUSet() cpuset.CPUSet DieIDs() []idset.ID NodeIDs() []idset.ID DieNodeIDs(idset.ID) []idset.ID DieCPUSet(idset.ID) cpuset.CPUSet SstInfo() *sst.SstPackageInfo }
CPUPackage is a physical package (a collection of CPUs).
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache has details about cache.
type EPP ¶ added in v0.5.0
type EPP int
EPP represents the value of a CPU energy performance profile
func EPPFromString ¶ added in v0.5.0
EPPFromString converts string to EPP value
type MemoryType ¶
type MemoryType int
MemoryType is an enum for the Node memory
const ( // MemoryTypeDRAM means that the node has regular DRAM-type memory MemoryTypeDRAM MemoryType = iota // MemoryTypePMEM means that the node has persistent memory MemoryTypePMEM // MemoryTypeHBM means that the node has high bandwidth memory MemoryTypeHBM )
type Node ¶
type Node interface { ID() idset.ID PackageID() idset.ID DieID() idset.ID CPUSet() cpuset.CPUSet Distance() []int DistanceFrom(id idset.ID) int MemoryInfo() (*MemInfo, error) GetMemoryType() MemoryType HasNormalMemory() bool }
Node represents a NUMA node.
type PickEntryFn ¶
PickEntryFn picks a given input line apart into an entry of key and value.
type System ¶
type System interface { Discover() error SetCpusOnline(online bool, cpus idset.IDSet) (idset.IDSet, error) SetCPUFrequencyLimits(min, max uint64, cpus idset.IDSet) error PackageIDs() []idset.ID NodeIDs() []idset.ID CPUIDs() []idset.ID PackageCount() int SocketCount() int CPUCount() int NUMANodeCount() int ThreadCount() int CPUSet() cpuset.CPUSet Package(id idset.ID) CPUPackage Node(id idset.ID) Node NodeDistance(from, to idset.ID) int CPU(id idset.ID) CPU Offlined() cpuset.CPUSet Isolated() cpuset.CPUSet }
System devices
func DiscoverSystem ¶
DiscoverSystem performs discovery of the running systems details.
func DiscoverSystemAt ¶
DiscoverSystemAt performs discovery of the running systems details from sysfs mounted at path.