Skip to content
Snippets Groups Projects
Commit a7d24f12 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component:

Fix monitoring loops to align with changes in monitoring component information model.
parent a199e68d
No related branches found
No related tags found
1 merge request!54Release 2.0.0
......@@ -129,8 +129,8 @@ class MonitoringLoops:
# FIXME: uint32 used for intVal results in out of range issues. Temporarily changed to float
# extend the 'kpi_value' to support long integers (uint64 / int64 / ...)
if isinstance(value, int):
kpi_value_field_name = 'floatVal' # 'intVal'
kpi_value_field_cast = float # int
kpi_value_field_name = 'int64Val'
kpi_value_field_cast = int
elif isinstance(value, float):
kpi_value_field_name = 'floatVal'
kpi_value_field_cast = float
......@@ -144,7 +144,7 @@ class MonitoringLoops:
try:
self._monitoring_client.IncludeKpi(Kpi(**{
'kpi_id' : {'kpi_id': {'uuid': db_kpi.kpi_uuid}},
'timestamp': datetime.utcfromtimestamp(timestamp).isoformat() + 'Z',
'timestamp': {'timestamp': timestamp},
'kpi_value': {kpi_value_field_name: kpi_value_field_cast(value)}
}))
except: # pylint: disable=bare-except
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment