Skip to content
Snippets Groups Projects
Commit 68c1a2f1 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'fix-beam-error-timestamp' into 'master'

Fix type of timestamp (float instead of int)

See merge request !543
parents 0b97116d b7c36b15
No related branches found
No related tags found
1 merge request!543Fix type of timestamp (float instead of int)
...@@ -176,7 +176,7 @@ class CustomCollector(object): ...@@ -176,7 +176,7 @@ class CustomCollector(object):
attr_infos = {attr_info.name: attr_info for attr_info in dev.attribute_list_query()} attr_infos = {attr_info.name: attr_info for attr_info in dev.attribute_list_query()}
if dev.state() not in [DevState.STANDBY, DevState.ON, DevState.ALARM, DevState.DISABLE]: if dev.state() not in [DevState.STANDBY, DevState.ON, DevState.ALARM, DevState.DISABLE]:
logger.error(f"Error processing device {device_name}: it is in state {dev.state()}") logger.warning(f"Error processing device {device_name}: it is in state {dev.state()}")
# at least log state & status # at least log state & status
attrs_to_scrape = ["State", "Status"] attrs_to_scrape = ["State", "Status"]
...@@ -195,7 +195,7 @@ class CustomCollector(object): ...@@ -195,7 +195,7 @@ class CustomCollector(object):
metrics.extend(self.metrics(dev, attr_infos[attr_name], attr_value)) metrics.extend(self.metrics(dev, attr_infos[attr_name], attr_value))
except DevFailed as e: except DevFailed as e:
reason = e.args[0].desc.replace("\n", " ") reason = e.args[0].desc.replace("\n", " ")
logger.error(f"Error processing device {device_name} attribute {attr_name}: {reason}") logger.warning(f"Error processing device {device_name} attribute {attr_name}: {reason}")
except Exception as e: except Exception as e:
logger.exception(f"Error processing device {device_name} attribute {attr_name}") logger.exception(f"Error processing device {device_name} attribute {attr_name}")
...@@ -220,7 +220,7 @@ class CustomCollector(object): ...@@ -220,7 +220,7 @@ class CustomCollector(object):
attribute_metrics.add_metric(*metric) attribute_metrics.add_metric(*metric)
except DevFailed as e: except DevFailed as e:
reason = e.args[0].desc.replace("\n", " ") reason = e.args[0].desc.replace("\n", " ")
logger.error(f"Error processing device {device_name}: {reason}") logger.warning(f"Error processing device {device_name}: {reason}")
except Exception as e: except Exception as e:
logger.exception(f"Error processing device {device_name}") logger.exception(f"Error processing device {device_name}")
finally: finally:
......
...@@ -191,10 +191,10 @@ class BeamDevice(LOFARDevice): ...@@ -191,10 +191,10 @@ class BeamDevice(LOFARDevice):
access=AttrWriteType.READ, access=AttrWriteType.READ,
doc="When last thrown exception was thrown when updating the pointing in the Beam_tracker", doc="When last thrown exception was thrown when updating the pointing in the Beam_tracker",
unit="s", unit="s",
dtype=numpy.int64, dtype=numpy.float64,
fget=lambda self: self.Beam_tracker.last_update_exception_timestamp.timestamp() fget=lambda self: self.Beam_tracker.last_update_exception_timestamp.timestamp()
if self.Beam_tracker and self.Beam_tracker.last_update_exception_timestamp if self.Beam_tracker and self.Beam_tracker.last_update_exception_timestamp
else 0, else 0.0,
) )
def write_Pointing_direction_RW(self, value): def write_Pointing_direction_RW(self, value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment