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
No related branches found
No related tags found
No related merge requests found
......@@ -106,15 +106,19 @@ public class MonitoringAgent {
private static void checkAttribute(final String attributeName, final AttributeInsertionReport report) {
try {
TangoAttribute att = new TangoAttribute(attributeName);
report.setTangoMessage("Attribute connection OK");
String tangoMessage = "Attribute connection OK";
if (att.isScalar() && att.isNumber()) {
final String readValue = att.extract(String.class);
if (readValue.equalsIgnoreCase(Double.toString(Double.NaN))) {
report.setTangoMessage("Attribute value is NaN");
tangoMessage = "Attribute value is NaN";
}
} else {
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
// 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