topology

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

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 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 FindGivenSysFsDevice

func FindGivenSysFsDevice(devType string, major, minor int64) (string, error)

FindGivenSysFsDevice returns the physical device with the given device type, major, and minor numbers.

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 ResetLogger

func ResetLogger()

ResetLogger resets any externally set logger.

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

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
}

Logger is interface we expect from an optional, externally set logger.

func SetLogger

func SetLogger(l Logger) Logger

SetLogger sets the external logger used for (debug) logging.

Jump to

Keyboard shortcuts

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