introspect

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignment

type Assignment struct {
	ContainerID   string // ID of container for this assignment
	SharedCPUs    string // shared CPUs
	CPUShare      int    // CPU share/weight for SharedCPUs
	ExclusiveCPUs string // exclusive CPUs
	Memory        string // memory controllers
	Pool          string // pool container is assigned to
}

Assignment describes resource assignments for a single container.

type Container

type Container struct {
	ID            string        // container CRI ID
	Name          string        // container name
	Command       []string      // command
	Args          []string      // and its arguments
	CPURequest    int64         // CPU requested in milli-CPU (guaranteed amount)
	CPULimit      int64         // CPU limit in milli-CPU (maximum allowed CPU)
	MemoryRequest int64         // memory requested in bytes
	MemoryLimit   int64         // memory limit in bytes (maximum allowed memory)
	Hints         TopologyHints // topology/allocation hints
}

Container describes a single container.

type Node

type Node struct {
	ID   int    // node ID
	CPUs string // CPUs with locality for this NUMA node.
}

Node describes a single NUMA node in the system.

type Pod

type Pod struct {
	ID         string                // pod CRI ID
	UID        string                // pod kubernetes ID
	Name       string                // pod name
	Containers map[string]*Container // containers of this pod
}

Pod describes a single pod and its containers.

type Pool

type Pool struct {
	Name     string   // pool name
	CPUs     string   // CPUs in this pool
	Memory   string   // memory controllers (NUMA nodes) for this pool
	Parent   string   // parent pool
	Children []string // child pools
}

Pool describes a single (resource) pool.

type Server

type Server struct {
	sync.RWMutex // need to protect against concurrent introspection/update
	// contains filtered or unexported fields
}

Server is our server for external introspection.

func Setup

func Setup(mux *xhttp.ServeMux, state *State) (*Server, error)

Setup prepares the given HTTP request multiplexer for serving introspection.

func (*Server) Set

func (s *Server) Set(state *State) error

Set sets the current state for introspection.

func (*Server) Start

func (s *Server) Start()

Start enables serving HTTP requests.

func (*Server) Stop

func (s *Server) Stop()

Stop stops serving further HTTP requests.

type Socket

type Socket struct {
	ID   int    // CPU ID
	CPUs string // CPUs in this socket
}

Socket describes a single physical CPU socket in the system.

type State

type State struct {
	Pools       map[string]*Pool       // pools
	Pods        map[string]*Pod        // pods and containers
	Assignments map[string]*Assignment // resource assignments
	System      *System                // info about hardware/system
	Error       string
}

State is the current introspected state of the resource manager.

type System

type System struct {
	Sockets        map[int]*Socket // physical sockets in the system
	Nodes          map[int]*Node   // NUMA nodes in the system
	Isolated       string          // kernel-isolated CPUs
	Offlined       string          // CPUs offline
	RDTClasses     []string        // list of RDT classes
	BlockIOClasses []string        // list of block I/O classes
	Policy         string          // active policy
}

System describes the underlying HW/system.

type TopologyHints

type TopologyHints topology.Hints

TopologyHints contain a set of allocation hints for a container.

Jump to

Keyboard shortcuts

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