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: 3 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. Instead of returning a Go struct, JSON serialized bytes are returned. A function to deserialize the JSON serialized bytes into a node.Nodes struct is provided.

Note: the package name is node and not the final element of the import path (json).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(p []byte) (*numa.Nodes, error)

Deserialize takes some JSON serialized bytes and unmarshals them as node.Nodes.

func Get

func Get() (p []byte, err error)

Get returns the current node as JSON serialized bytes using the package's global Profiler.

func Marshal

func Marshal(nodes *numa.Nodes) ([]byte, error)

Marshal is an alias for Serialize using package globals.

func Serialize

func Serialize(nodes *numa.Nodes) (p []byte, err error)

Serialize node.Nodes as JSON using package globals.

func Unmarshal

func Unmarshal(p []byte) (*numa.Nodes, error)

Unmarshal is an alias for Deserialize using package globals.

Types

type Profiler

type Profiler struct {
	*numa.Profiler
}

Profiler is used to process the node information.

func NewProfiler

func NewProfiler() (prof *Profiler)

Initializes and returns a cpuinfo profiler.

func (*Profiler) Get

func (prof *Profiler) Get() (p []byte, err error)

Get returns the current cpuinfo as JSON serialized bytes.

func (*Profiler) Marshal

func (prof *Profiler) Marshal(nodes *numa.Nodes) ([]byte, error)

Marshal is an alias for serialize.

func (*Profiler) Serialize

func (prof *Profiler) Serialize(nodes *numa.Nodes) ([]byte, error)

Serialize node.Nodes as JSON.

Jump to

Keyboard shortcuts

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