process

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package process collects the metrics of the osapi process, and the conditions that its limits give, such as high memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateProcessConditions

func EvaluateProcessConditions(
	metrics *Metrics,
	thresholds ConditionThresholds,
	prev []job.Condition,
) []job.Condition

EvaluateProcessConditions evaluates process-level conditions against thresholds and returns the condition list. Tracks transition times using the previous condition state.

Types

type ConditionThresholds

type ConditionThresholds struct {
	// MemoryPressureBytes is the RSS threshold in bytes.
	MemoryPressureBytes int64
	// HighCPUPercent is the CPU usage threshold as a percentage.
	HighCPUPercent float64
}

ConditionThresholds holds thresholds for process-level conditions.

type Metrics

type Metrics struct {
	CPUPercent float64 `json:"cpu_percent"`
	RSSBytes   int64   `json:"rss_bytes"`
	Goroutines int     `json:"goroutines"`
}

Metrics holds process-level resource usage.

type Provider

type Provider interface {
	// GetMetrics retrieves resource usage for the current process.
	GetMetrics() (*Metrics, error)
}

Provider collects process metrics.

func New

func New() Provider

New returns a Provider for the current process on the real host.

Directories

Path Synopsis
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.

Jump to

Keyboard shortcuts

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