utils
drunc.controller.utils
Classes
ControllerMonitoringMetrics(run_type='', trigger_rate=0.0, run_number=0, disable_data_storage=False, run_time_at_start=0, run_time_since_start=0)
dataclass
Store the metrics that the OpMon Controller publishes
Functions:
count_processes_in_status_response(response)
Count the number of processes in the status table, including all children.
This function is recursive to allow for the counting of processes following a nested
structure of StatusResponse objects through the child attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
StatusResponse
|
The StatusResponse object returrned from a controller servicer status request. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The total number of processes in the status table. |
Source code in drunc/controller/utils.py
get_all_apps_with_named_substate(response, substate_query)
Recursively searches for app names with a specific substate in StatusResponse and its children.
Source code in drunc/controller/utils.py
get_all_states(response)
Recursively extracts 'state' from StatusResponse and its children.