MonitorApi#
- class ansys.hps.client.monitor.api.MonitorApi(client, ws_connection_options=None, timeout_seconds=10.0, ws_url=None)#
Client for the HPS monitor REST and WebSocket interfaces.
- Parameters:
- client
Client Pre-authenticated HPS client. REST requests are routed through
client.sessionand monitor URLs are derived fromclient.url.- ws_connection_options
dict[str,Any],optional Keyword arguments forwarded to
websocket.create_connectionfor WebSocket calls. Useful for local or self-signed environments, for example{"sslopt": {"cert_reqs": ssl.CERT_NONE}}. The default isNone.- timeout_seconds
float,optional Timeout in seconds used for all network operations. The default is
10.0.- ws_url
str,optional Full WebSocket URL override, for example
wss://localhost:8443/hps/monitor/ws/topics. If omitted, the URL is derived fromclient.url. The default isNone.
- client
Notes
Common filter tags:
client_type,task_id,project_id,job_id,evaluator_name,host,file_path,level. For metric messages:type=metric,statistic(e.g.process_tree). SeeClientTypefor knownclient_typevalues.Initialize the MonitorApi client.
Methods
Fetch monitor service build metadata from the REST API.
MonitorApi.get_task_process_tree(task_id, *)Return process tree metric messages for a specific task.
MonitorApi.list_topics([limit, exclude_noisy])List all known tag keys and their values via the WebSocket
list_tagsaction.Infer project ID for a task from task-log message tags.
MonitorApi.send_ws_command(command[, ...])Send a command to the monitor WebSocket endpoint and collect messages.
Stream scheduler job status metrics for a task definition.
MonitorApi.stream_service_logs(client_type, *)Stream log messages for a named HPS service.
MonitorApi.stream_task_host_resources(...[, ...])Stream CPU and memory metric updates for the host running a specific task.
MonitorApi.stream_task_logs(task_id, *[, ...])Stream log file messages for a specific task.
MonitorApi.stream_task_process_tree(task_id, *)Stream process tree metric updates for a specific task.
Attributes
Base URL for monitor endpoints derived from the authenticated client.
JWT token sourced from the authenticated client when available.
WebSocket topics URL for the monitor endpoint.