pyfebiopt.monitoring.monitoring_service

Controller that wires together registry, event listener, and system stats.

Classes

MonitoringService

Own the monitor registry, event socket listener, and system stats.

Module Contents

class pyfebiopt.monitoring.monitoring_service.MonitoringService(*, registry_path: pathlib.Path | None = None, event_socket: pathlib.Path | None = None, storage_roots: collections.abc.Iterable[pathlib.Path] | None = None, poll_interval: float = 5.0, stats_collector: pyfebiopt.monitoring.system_stats.SystemStatsCollector | None = None, stale_after: float = 180.0, stale_interval: float = 30.0)

Own the monitor registry, event socket listener, and system stats.

Initialize registry, listener config, and stats collector.

Parameters:
  • registry_path – Optional path for the run registry JSON.

  • event_socket – Optional UNIX socket path for event ingestion.

  • storage_roots – Optional storage roots to inventory for jobs.

  • poll_interval – Seconds between inventory refreshes.

  • stats_collector – Custom collector; defaults to SystemStatsCollector.

  • stale_after – Seconds before an active run with no process is marked unknown.

  • stale_interval – Seconds between stale-run sweeps.

registry
event_socket
inventory
stats
start() None

Start the event listener if configured and not already running.

stop() None

Stop the event listener if it is running.

property running: bool

Return True when the event listener is active.