rdt

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// RootClassName is the name we use in our config for the special class
	// that configures the "root" resctrl group of the system
	RootClassName = "SYSTEM_DEFAULT"
)

Variables

This section is empty.

Functions

func GetMonFeatures

func GetMonFeatures() map[MonResource][]string

GetMonFeatures returns the available monitoring stats of each available monitoring technology

func Initialize

func Initialize() error

Initialize discovers RDT support and initializes the rdtControl singleton interface NOTE: should only be called once in order to avoid adding multiple notifiers TODO: support make multiple initializations, allowing e.g. "hot-plug" when

resctrl filesystem is mounted

func MonSupported

func MonSupported() bool

MonSupported returns true if RDT monitoring features are available

func NewCollector

func NewCollector() (prometheus.Collector, error)

NewCollector creates new Prometheus collector of RDT metrics

func RegisterCustomPrometheusLabels

func RegisterCustomPrometheusLabels(names ...string)

RegisterCustomPrometheusLabels registers monitor group annotations to be exported as Prometheus metrics labels

Types

type Bitmask

type Bitmask uint64

Bitmask represents a generic 64 bit wide bitmask

func ListStrToBitmask

func ListStrToBitmask(str string) (Bitmask, error)

ListStrToBitmask parses a string containing a human-readable list of bit numbers into a bitmask

func (Bitmask) ListStr

func (b Bitmask) ListStr() string

ListStr prints the bitmask in human-readable format, similar to e.g. the cpuset format of the Linux kernel

func (Bitmask) MarshalJSON

func (b Bitmask) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface of "encoding/json"

type CtrlGroup

type CtrlGroup interface {
	ResctrlGroup

	// CreateMonGroup creates a new monitoring group under the class.
	CreateMonGroup(name string, annotations map[string]string) (MonGroup, error)

	// DeleteMonGroup deletes a monitoring group from the class.
	DeleteMonGroup(name string) error

	// GetMonGroup returns a specific monitoring group under the class
	GetMonGroup(name string) (MonGroup, bool)

	// GetMonGroups returns all monitoring groups under the class
	GetMonGroups() []MonGroup
}

CtrlGroup defines the interface of one cri-resmgr managed RDT class

func GetClass

func GetClass(name string) (CtrlGroup, bool)

GetClass returns one RDT class

func GetClasses

func GetClasses() []CtrlGroup

GetClasses returns all available RDT classes

type MonData

type MonData struct {
	L3 MonL3Data
}

MonData contains monitoring stats of one monitoring group

type MonGroup

type MonGroup interface {
	ResctrlGroup

	// Parent returns the CtrlGroup under which the monitoring group exists
	Parent() CtrlGroup

	// GetAnnotations returns the annotations stored to the monitoring group
	GetAnnotations() map[string]string
}

MonGroup represents the interface to a RDT monitoring group

type MonL3Data

type MonL3Data map[uint64]MonLeafData

MonL3Data contains L3 monitoring stats of one monitoring group

type MonLeafData

type MonLeafData map[string]uint64

MonLeafData represents the raw numerical stats from one RDT monitor data leaf

type MonResource

type MonResource string

MonResource is the type of RDT monitoring resource

const (
	// MonResourceL3 is the RDT L3 cache monitor resource
	MonResourceL3 MonResource = "l3"
)

type ResctrlGroup

type ResctrlGroup interface {
	// Name returns the name of the group
	Name() string

	// GetPids returns the process ids assigned to the group
	GetPids() ([]string, error)

	// AddPids assigns the given process ids to the group
	AddPids(pids ...string) error

	// GetMonData retrieves the monitoring data of the group
	GetMonData() MonData
}

ResctrlGroup is the generic interface for resctrl CTRL and MON groups

Jump to

Keyboard shortcuts

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