SIENTIAPDE-1169

Refactor OPC metrics to use unpacking for CORE_LABELS in metrics.py

- Updated the definition of prediction OPC writing metrics to utilize unpacking for CORE_LABELS, enhancing code clarity and maintainability.
This commit is contained in:
vitor-aignosi
2025-08-18 14:17:43 -03:00
parent e567b8d0a7
commit 37a31a51a4

View File

@@ -30,12 +30,12 @@ PREDICTION_RESPONSE_TIME_MONITOR = Histogram(
PREDICTION_OPC_WRITING_COUNT = Counter( PREDICTION_OPC_WRITING_COUNT = Counter(
"laborious_prediction_opc_writing_count", "laborious_prediction_opc_writing_count",
"Number of predictions written to the OPC server", "Number of predictions written to the OPC server",
[CORE_LABELS, "opc_server_id"], [*CORE_LABELS, "opc_server_id"],
) )
PREDICTION_OPC_WRITING_RESPONSE_TIME_MONITOR = Histogram( PREDICTION_OPC_WRITING_RESPONSE_TIME_MONITOR = Histogram(
"laborious_prediction_opc_writing_response_time_monitor", "laborious_prediction_opc_writing_response_time_monitor",
"Current response time of each prediction written to the OPC server", "Current response time of each prediction written to the OPC server",
[CORE_LABELS, "opc_server_id"], [*CORE_LABELS, "opc_server_id"],
buckets=[0.01, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0] buckets=[0.01, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0]
) )