status

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 18 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 status implements status, sweep and doctor (spec 3.3).

Index

Constants

View Source
const StaleStaging = 6 * time.Hour

StaleStaging is the age after which sweep removes an artifact staging dir (spec 3.3).

Variables

View Source
var RemoteDoctor func(e *config.Effective, out io.Writer) (failed, unusable bool)

RemoteDoctor runs the --remote checks. unusable reports a configuration the host cannot run (an agent module_dir that is not a clean git tree): doctor exits 78 for it, not 69.

View Source
var RemoteSection func(e *config.Effective) any

RemoteSection fills Report.Remote (set by the remote status code).

View Source
var RemoteSweep func(ctx context.Context, e *config.Effective, dryRun bool, provider string, foreign bool, out io.Writer)

RemoteSweep is the remote part of sweep.

Functions

func Doctor

func Doctor(e *config.Effective, l state.Layout, out io.Writer) (failed bool)

Doctor prints "ok|warn|fail <check>: <detail>" lines; failed reports any fail (spec 3.3).

func Redactor

func Redactor(e *config.Effective) *redact.Set

Redactor is the set the run path builds from the loaded config: every credential value.

func Sweep

func Sweep(e *config.Effective, l state.Layout, dryRun bool, out io.Writer) error

Sweep cleans local state (spec 3.3): dead tickets and their process groups, dead supervisors' records (lost), history rotation, retention and stale artifact staging dirs. It never fails on one bad item.

Types

type Group

type Group struct {
	Name  string `json:"name"`
	Units int    `json:"units"`
	Held  []int  `json:"held"`
}

type Holder

type Holder struct {
	Job      string   `json:"job"`
	Slot     int      `json:"slot"`
	Pid      int      `json:"pid"`
	Cwd      string   `json:"cwd"`
	Argv     []string `json:"argv"`
	Provider string   `json:"provider"`
	Nested   bool     `json:"nested"`
	Since    string   `json:"since"`
	Legacy   bool     `json:"legacy,omitempty"` // a legacy shell-pool caller holds <legacy_dir>/locks/<pool>.<slot>.lock
}

type Memory

type Memory struct {
	AvailableMiB int64  `json:"available_mib"`
	Readable     bool   `json:"readable"`
	Source       string `json:"source"`
	FloorMiB     int64  `json:"floor_mib"`
}

type Pool

type Pool struct {
	Name        string   `json:"name"`
	Slots       int      `json:"slots"`
	Holders     []Holder `json:"holders"`
	Waiters     []Waiter `json:"waiters"`
	LastStarved string   `json:"last_starved,omitempty"`
}

type Report

type Report struct {
	Version string   `json:"version"`
	Time    string   `json:"time"`
	Pools   []Pool   `json:"pools"`
	Groups  []Group  `json:"groups"`
	Memory  Memory   `json:"memory"`
	Legacy  []string `json:"legacy,omitempty"`
	Remote  any      `json:"remote,omitempty"`
}

Report is `status --json` (docs/status.schema.json).

func Snapshot

func Snapshot(e *config.Effective, l state.Layout, only []string) Report

Snapshot reads tickets, locks and memory without taking any lock: holders come from /proc/locks (lock.HeldRO), so a concurrent `--wait 0s` caller or a legacy `flock -n` never sees a lock made busy by status (read-only, best effort).

func (Report) Text

func (r Report) Text(w io.Writer)

Text prints the report for people.

type Waiter

type Waiter struct {
	Job      string `json:"job"`
	Class    string `json:"class"` // high | normal
	Pid      int    `json:"pid"`
	Since    string `json:"since"`
	Blocking string `json:"group_wait,omitempty"`
}

Jump to

Keyboard shortcuts

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