launcher
ipw.telemetry.launcher
¶
Process management helpers for the bundled energy monitor.
normalize_target(target)
¶
Normalize a target string into host:port form.
Source code in intelligence-per-watt/src/ipw/telemetry/launcher.py
wait_for_ready(target=DEFAULT_TARGET, *, timeout=5.0)
¶
Return True when the energy monitor responds to a health check.
Source code in intelligence-per-watt/src/ipw/telemetry/launcher.py
launch_monitor(args=None, *, env=None, timeout=5.0, target=DEFAULT_TARGET)
¶
Launch the energy monitor and wait for it to become ready.
Returns a tuple of (pid, target). Raises RuntimeError if readiness
is not achieved within timeout seconds.
Source code in intelligence-per-watt/src/ipw/telemetry/launcher.py
ensure_monitor(target=DEFAULT_TARGET, *, timeout=5.0, launch=True, launch_args=None, env=None)
¶
Ensure a monitor is reachable, optionally launching one in the background.
Yields the normalized target string. If launch is True, a background
process will be spawned when the target is unavailable. The caller is
responsible for any teardown when the context exits.