node

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package node gets information about the system's NUMA nodes. This looks at the sysfs's node tree and extracts information about each node. If the node tree doesn't exist on the system, instead of node information, an os.ErrNotExist will be returned.

Index

Constants

View Source
const CPUList = "cpulist"

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID      int32  `json:"id"` // max_numa_node returns an int (in C)
	CPUList string `json:"cpu_list"`
}

Information about a specific node.

type Nodes

type Nodes struct {
	Node []Node `json:"node"`
}

func (*Nodes) NumaNodes

func (n *Nodes) NumaNodes() int

NumaNodes returns the number of numa nodes for the system.

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

Profiler is used to process the system's sysfs node information.

func NewProfiler

func NewProfiler() (prof *Profiler)

Returns an initialized Profiler.

func (*Profiler) CPUList

func (prof *Profiler) CPUList(path string) (string, error)

CPUList returns the string found in the CPUList file or any error that occurs.

func (*Profiler) Get

func (prof *Profiler) Get() (nodes *Nodes, err error)

Get the node information. If the node tree doesn't exist an os.ErrNotExist will be returned. During processing, any error will be returned along with a nil for nodes.

func (*Profiler) Reset

func (prof *Profiler) Reset() error

Rest resources: this does nothing for this implemtation.

func (*Profiler) SysFSSystemPath

func (prof *Profiler) SysFSSystemPath(s string)

SysFSSystemPath enables overriding the default value. This is for testing and should be used outside of tests.

Directories

Path Synopsis
Package node gets information about the system's NUMA nodes.
Package node gets information about the system's NUMA nodes.
Package node gets information about the system's NUMA nodes.
Package node gets information about the system's NUMA nodes.

Jump to

Keyboard shortcuts

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