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 ¶
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 ¶
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 ¶
PanelAgent is one agent's windowed net cr/jump for the panel ranking.