stream_scheduler_job_status#
- MonitorApi.stream_scheduler_job_status(task_definition_id, *, backlog=100, max_messages=None)#
Stream scheduler job status metrics for a task definition.
Subscribes to
scaler_instancesmetric messages emitted by the HPS autoscaling service (ansys.rep.scaling) for a specific task definition. Each message represents a status update from the underlying job scheduler (e.g. Slurm or LSF) and contains instance-count information for the registered scaler.- Return type:
- Parameters:
- task_definition_id
str The task definition identifier to monitor.
- backlog
int,optional Number of historical metric messages to request on connect. The default is
100.- max_messages
intorNone,optional Maximum total messages to yield before closing the connection. The default is
None, which streams indefinitely until interrupted or the server closes the connection.
- task_definition_id
- Yields:
MonitorMessageParsed JSON scheduler job status metric dicts from the server.
Examples
>>> for status in api.stream_scheduler_job_status("taskdef-abc"): ... print(status)