procstats

package
v0.0.0-...-6dcf2a5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The statistics the basic executor exposes
	ExecutorBasicMeasuredMemStats = []string{"RSS", "Swap"}
	ExecutorBasicMeasuredCpuStats = []string{"System Mode", "User Mode", "Percent"}
)

Functions

func Aggregate

func Aggregate(systemStats *cpustats.Tracker, procStats ProcUsages) *drivers.TaskResourceUsage

Aggregate combines a given ProcUsages with the Tracker for the Client.

func List

func List(cg Cgrouper) *set.Set[ProcessID]

Types

type Cgrouper

type Cgrouper interface {
	StatsCgroup() string
}

type ProcUsages

type ProcUsages map[string]*drivers.ResourceUsage

ProcUsages is a map from PID to the resources that process is consuming.

The pid type is a string because that's how Nomad wants it.

type ProcessID

type ProcessID = int

ProcessID is an alias for int; it just helps us identify where PIDs from the kernel are being used.

type ProcessList

type ProcessList interface {
	ListProcesses() *set.Set[ProcessID]
}

A ProcessList is anything (i.e. a task driver) that implements ListProcesses for gathering the list of process IDs associated with a task.

type ProcessStats

type ProcessStats interface {
	StatProcesses() ProcUsages
}

A ProcessStats is anything (i.e. a task driver) that implements StatProcesses for gathering CPU and memory process stats for all processes associated with a task.

func New

func New(compute cpustats.Compute, pl ProcessList) ProcessStats

Jump to

Keyboard shortcuts

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