process

package
v0.0.0-...-443440a Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package process provides resource usage metrics for the current process.

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 creates a new Provider that reports metrics for the current process.

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