pyfebiopt.monitoring.state

Track manifest-based jobs and runtime updates for the monitor UI.

Classes

ArtifactInfo

Describe a file artifact attached to a job.

JobInfo

Hold metadata for a stored monitoring job.

StorageInventory

Scan manifest roots and build a current view of stored jobs.

Module Contents

class pyfebiopt.monitoring.state.ArtifactInfo

Describe a file artifact attached to a job.

kind: str
path: pathlib.Path
size: int
class pyfebiopt.monitoring.state.JobInfo

Hold metadata for a stored monitoring job.

project: str
iter_id: int
case: str
tag: str
status: str
started_at: float
ended_at: float
placement_root: pathlib.Path
artifacts: list[ArtifactInfo] = []
summary: dict[str, float]
meta: dict[str, object]
property job_id: str

Return the stable identifier for this job.

class pyfebiopt.monitoring.state.StorageInventory(roots: collections.abc.Iterable[pathlib.Path], *, poll_interval: float = 5.0)

Scan manifest roots and build a current view of stored jobs.

Set up the inventory scanner with the provided storage roots.

roots
poll_interval
refresh(force: bool = False) None

Refresh the inventory if the poll interval allows or forcing is requested.

list_jobs() list[JobInfo]

Return the current snapshot of discovered jobs.

get_job(job_id: str) JobInfo | None

Lookup a job by its identifier.

Returns:

Job metadata if known, else None.

Return type:

JobInfo | None

apply_event(job_id: str, event: str, payload: dict[str, object], ts: float) None

Ingest a monitor event to keep job metadata fresh.