topology

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderKubelet is a constant to distinguish that topology hint comes
	// from parameters passed to CRI create/update requests from Kubelet.
	ProviderKubelet = "kubelet"
)

Variables

This section is empty.

Functions

func FindSysFsDevice

func FindSysFsDevice(dev string) (string, error)

FindSysFsDevice for given argument returns physical device where it is linked to. For device nodes it will return path for device itself. For regular files or directories this function returns physical device where this inode resides (storage device). If result device is a virtual one (e.g. tmpfs), error will be returned. For non-existing path, no error returned and path is empty.

func GetTopologyInfo

func GetTopologyInfo(devs []string) (*pluginapi.TopologyInfo, error)

GetTopologyInfo returns topology information for the list of device nodes.

Types

type Hint

type Hint struct {
	Provider string
	CPUs     string
	NUMAs    string
	Sockets  string
}

Hint represents various hints that can be detected from sysfs for the device.

func (*Hint) String

func (h *Hint) String() string

String returns the hints as a string.

type Hints

type Hints map[string]Hint

Hints represents set of hints collected from multiple providers.

func MergeTopologyHints

func MergeTopologyHints(org, hints Hints) (res Hints)

MergeTopologyHints combines org and hints.

func NewTopologyHints

func NewTopologyHints(devPath string) (hints Hints, err error)

NewTopologyHints return array of hints for the main device and its dependend devices (e.g. RAID).

Jump to

Keyboard shortcuts

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