process

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 6 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 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