Documentation
¶
Overview ¶
Package topology contains helpers for the CPU manager.
Index ¶
- type CPUDetails
- func (d CPUDetails) CPUs() cpuset.CPUSet
- func (d CPUDetails) CPUsInCores(ids ...int) cpuset.CPUSet
- func (d CPUDetails) CPUsInNUMANodes(ids ...int) cpuset.CPUSet
- func (d CPUDetails) CPUsInSockets(ids ...int) cpuset.CPUSet
- func (d CPUDetails) Cores() cpuset.CPUSet
- func (d CPUDetails) CoresInNUMANodes(ids ...int) cpuset.CPUSet
- func (d CPUDetails) CoresInSockets(ids ...int) cpuset.CPUSet
- func (d CPUDetails) KeepOnly(cpus cpuset.CPUSet) CPUDetails
- func (d CPUDetails) NUMANodes() cpuset.CPUSet
- func (d CPUDetails) NUMANodesInSockets(ids ...int) cpuset.CPUSet
- func (d CPUDetails) Sockets() cpuset.CPUSet
- func (d CPUDetails) SocketsInNUMANodes(ids ...int) cpuset.CPUSet
- type CPUInfo
- type CPUTopology
- type NUMANodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUDetails ¶
CPUDetails is a map from CPU ID to Core ID, Socket ID, and NUMA ID.
func (CPUDetails) CPUs ¶
func (d CPUDetails) CPUs() cpuset.CPUSet
CPUs returns all of the logical CPU IDs in this CPUDetails.
func (CPUDetails) CPUsInCores ¶
func (d CPUDetails) CPUsInCores(ids ...int) cpuset.CPUSet
CPUsInCores returns all of the logical CPU IDs associated with the given core IDs in this CPUDetails.
func (CPUDetails) CPUsInNUMANodes ¶
func (d CPUDetails) CPUsInNUMANodes(ids ...int) cpuset.CPUSet
CPUsInNUMANodes returns all of the logical CPU IDs associated with the given NUMANode IDs in this CPUDetails.
func (CPUDetails) CPUsInSockets ¶
func (d CPUDetails) CPUsInSockets(ids ...int) cpuset.CPUSet
CPUsInSockets returns all of the logical CPU IDs associated with the given socket IDs in this CPUDetails.
func (CPUDetails) Cores ¶
func (d CPUDetails) Cores() cpuset.CPUSet
Cores returns all of the core IDs associated with the CPUs in this CPUDetails.
func (CPUDetails) CoresInNUMANodes ¶
func (d CPUDetails) CoresInNUMANodes(ids ...int) cpuset.CPUSet
CoresInNUMANodes returns all of the core IDs associated with the given NUMANode IDs in this CPUDetails.
func (CPUDetails) CoresInSockets ¶
func (d CPUDetails) CoresInSockets(ids ...int) cpuset.CPUSet
CoresInSockets returns all of the core IDs associated with the given socket IDs in this CPUDetails.
func (CPUDetails) KeepOnly ¶
func (d CPUDetails) KeepOnly(cpus cpuset.CPUSet) CPUDetails
KeepOnly returns a new CPUDetails object with only the supplied cpus.
func (CPUDetails) NUMANodes ¶
func (d CPUDetails) NUMANodes() cpuset.CPUSet
NUMANodes returns all of the NUMANode IDs associated with the CPUs in this CPUDetails.
func (CPUDetails) NUMANodesInSockets ¶
func (d CPUDetails) NUMANodesInSockets(ids ...int) cpuset.CPUSet
NUMANodesInSockets returns all of the logical NUMANode IDs associated with the given socket IDs in this CPUDetails.
func (CPUDetails) Sockets ¶
func (d CPUDetails) Sockets() cpuset.CPUSet
Sockets returns all of the socket IDs associated with the CPUs in this CPUDetails.
func (CPUDetails) SocketsInNUMANodes ¶
func (d CPUDetails) SocketsInNUMANodes(ids ...int) cpuset.CPUSet
SocketsInNUMANodes returns all of the logical Socket IDs associated with the given NUMANode IDs in this CPUDetails.
type CPUTopology ¶
type CPUTopology struct { NumCPUs int NumCores int NumSockets int NumNUMANodes int CPUDetails CPUDetails }
CPUTopology contains details of node cpu, where : CPU - logical CPU, cadvisor - thread Core - physical CPU, cadvisor - Core Socket - socket, cadvisor - Socket NUMA Node - NUMA cell, cadvisor - Node
func Discover ¶
func Discover(machineInfo *cadvisorapi.MachineInfo) (*CPUTopology, error)
Discover returns CPUTopology based on cadvisor node info
func (*CPUTopology) CPUCoreID ¶
func (topo *CPUTopology) CPUCoreID(cpu int) (int, error)
CPUCoreID returns the physical core ID which the given logical CPU belongs to.
func (*CPUTopology) CPUNUMANodeID ¶
func (topo *CPUTopology) CPUNUMANodeID(cpu int) (int, error)
CPUCoreID returns the NUMA node ID which the given logical CPU belongs to.
func (*CPUTopology) CPUSocketID ¶
func (topo *CPUTopology) CPUSocketID(cpu int) (int, error)
CPUCoreID returns the socket ID which the given logical CPU belongs to.
func (*CPUTopology) CPUsPerCore ¶
func (topo *CPUTopology) CPUsPerCore() int
CPUsPerCore returns the number of logical CPUs are associated with each core.
func (*CPUTopology) CPUsPerSocket ¶
func (topo *CPUTopology) CPUsPerSocket() int
CPUsPerSocket returns the number of logical CPUs are associated with each socket.
type NUMANodeInfo ¶
NUMANodeInfo is a map from NUMANode ID to a list of CPU IDs associated with that NUMANode.