ovstatus

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 6 Imported by: ? 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 ovstatus renders a live status page for one or more overminds.

Each overmind writes a balances.StatusFile (captured_at + workers[]) on every heartbeat tick. This package reads those files on demand and renders a single HTML page: a table of contents listing every overmind, then one alphabetical worker table per overmind showing name, credits, fleet role, current task/status, and last position. The page is re-rendered on every request, so a manual browser refresh always reflects the newest snapshot the overminds have written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerJumpMetrics

func PerJumpMetrics(sumProfit float64, sumJumps int64, fuelPerJump, fuelCrPerUnit float64) (gross, fuelCr, net float64)

PerJumpMetrics returns gross, fuel, and net credits-per-jump for a haul aggregate. fuelPerJump is fuel units burned per jump; fuelCrPerUnit is the credit price per fuel unit; their product is the (constant) fuel cr/jump. When sumJumps <= 0 all three are 0 (no hauls, no divide).

func Render

func Render(sources []Source, hs *HaulStats, refresh int, now time.Time) string

Render reads every source and returns a complete HTML document. refresh is the auto-refresh interval in seconds (a meta-refresh); now is the reference time used for relative "last seen" text and staleness. Sources that fail to load are rendered with an inline error rather than failing the whole page.

Types

type AgentLifetime

type AgentLifetime struct {
	Hauls      int
	Jumps      int64
	AvgPerJump float64
}

AgentLifetime is one worker's lifetime stats line (gross avg, no fuel term).

type EffPanel

type EffPanel struct {
	WindowLabel  string
	Hauls        int
	GrossPerJump float64
	FuelPerJump  float64
	NetPerJump   float64
	Agents       []PanelAgent // ranked NetPerJump desc (caller sorts)
}

EffPanel is the fleet efficiency headline: windowed gross/fuel/net cr/jump and a per-agent net/jump ranking.

type HaulStats

type HaulStats struct {
	Panel    *EffPanel                // nil -> no panel
	Lifetime map[string]AgentLifetime // agent_id -> per-worker line; absent -> no line
}

HaulStats bundles the haul-fleet efficiency data rendered onto the page: an optional fleet panel and a per-agent lifetime line map. A nil *HaulStats (or nil fields) renders the page exactly as before.

type PanelAgent

type PanelAgent struct {
	AgentID    string
	Hauls      int
	NetPerJump float64
}

PanelAgent is one agent's windowed net cr/jump for the panel ranking.

type Source

type Source struct {
	// Name is the human-readable overmind label shown on the page (e.g. "Haul").
	Name string
	// Path is the path to that overmind's status JSON file.
	Path string
}

Source identifies one overmind's live status file.

Jump to

Keyboard shortcuts

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