topology

package module
v0.0.0-...-ab87e23 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 7 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 SetSysRoot

func SetSysRoot(root string)

SetSysRoot sets the sysfs root directory to use.

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 device and its slaves (e.g. RAID).

Jump to

Keyboard shortcuts

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