Skip to content
Snippets Groups Projects
Commit 66bdf9b3 authored by gwen-soleil's avatar gwen-soleil
Browse files

add attribute timestamp in diagnosis

parent ab088dbc
Branches
Tags
No related merge requests found
...@@ -106,15 +106,19 @@ public class MonitoringAgent { ...@@ -106,15 +106,19 @@ public class MonitoringAgent {
private static void checkAttribute(final String attributeName, final AttributeInsertionReport report) { private static void checkAttribute(final String attributeName, final AttributeInsertionReport report) {
try { try {
TangoAttribute att = new TangoAttribute(attributeName); TangoAttribute att = new TangoAttribute(attributeName);
report.setTangoMessage("Attribute connection OK"); String tangoMessage = "Attribute connection OK";
if (att.isScalar() && att.isNumber()) { if (att.isScalar() && att.isNumber()) {
final String readValue = att.extract(String.class); final String readValue = att.extract(String.class);
if (readValue.equalsIgnoreCase(Double.toString(Double.NaN))) { if (readValue.equalsIgnoreCase(Double.toString(Double.NaN))) {
report.setTangoMessage("Attribute value is NaN"); tangoMessage = "Attribute value is NaN";
} }
} else { } else {
att.extract(); att.extract();
} }
final long lastTimeStamp = att.getTimestamp();
tangoMessage += ", read timestamp is " + (System.currentTimeMillis() - lastTimeStamp) + " ms ago";
report.setTangoMessage(tangoMessage);
// TODO check if type of format has changed // TODO check if type of format has changed
// Get current error message from archiver // Get current error message from archiver
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment