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_instances metric 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:

Generator[MonitorMessage, None, None]

Parameters:
task_definition_idstr

The task definition identifier to monitor.

backlogint, optional

Number of historical metric messages to request on connect. The default is 100.

max_messagesint or None, 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.

Yields:
MonitorMessage

Parsed JSON scheduler job status metric dicts from the server.

Examples

>>> for status in api.stream_scheduler_job_status("taskdef-abc"):
...     print(status)