SIENTIAPDE-1712
Refactor metrics and API handling for improved consistency and clarity - Removed the SIENTIA_CORE_LABELS constant and replaced it with CORE_LABELS for uniformity across metrics. - Updated the API class to ensure operation_type is always included in core labels for PI Web API metrics. - Simplified metric tag handling in the Gates class by consolidating common tags into a single core_tags dictionary. - Enhanced the PredictionProcess class to improve error handling and variable naming for clarity.
This commit is contained in:
@@ -81,18 +81,17 @@ def test_get_pi_web_api_core_labels_without_operation_type(mock_pi_web_api_clien
|
||||
'runtime': 'local',
|
||||
'model_name': 'test_model',
|
||||
'workflow_name': 'test_workflow',
|
||||
'operation_type': '-',
|
||||
'operation_type': 'write_pi_web_api_data',
|
||||
},
|
||||
):
|
||||
labels = api_instance.get_pi_web_api_core_labels(
|
||||
metadata=metadata['metadata'], operation_type=None
|
||||
)
|
||||
assert 'operation_type' not in labels
|
||||
labels = api_instance.get_pi_web_api_core_labels(metadata=metadata['metadata'])
|
||||
assert labels['operation_type'] == 'write_pi_web_api_data'
|
||||
assert labels == {
|
||||
'pod_id': 'test_pod',
|
||||
'runtime': 'local',
|
||||
'model_name': 'test_model',
|
||||
'workflow_name': 'test_workflow',
|
||||
'operation_type': 'write_pi_web_api_data',
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user