Browse Source

CF monitoring fixes

pull/13366/head
ViacheslavKlimov 1 year ago
parent
commit
fd66c5f177
  1. 1
      monitoring/src/main/java/org/thingsboard/monitoring/data/MonitoredServiceKey.java
  2. 6
      monitoring/src/main/java/org/thingsboard/monitoring/service/BaseHealthChecker.java

1
monitoring/src/main/java/org/thingsboard/monitoring/data/MonitoredServiceKey.java

@ -19,6 +19,5 @@ public class MonitoredServiceKey {
public static final String GENERAL = "Monitoring";
public static final String EDQS = "*EDQS*";
public static final String CF = "*CF*";
}

6
monitoring/src/main/java/org/thingsboard/monitoring/service/BaseHealthChecker.java

@ -117,11 +117,9 @@ public abstract class BaseHealthChecker<C extends MonitoringConfig, T extends Mo
String cfTestValue = testValue + "-cf";
String actualCfValue = latest.get(TEST_CF_TELEMETRY_KEY);
if (actualCfValue == null) {
throw new ServiceFailureException(MonitoredServiceKey.CF, "No CF value arrived");
throw new ServiceFailureException(info, "No calculated field value arrived");
} else if (!cfTestValue.equals(actualCfValue)) {
throw new ServiceFailureException(MonitoredServiceKey.CF, "Was expecting CF value " + cfTestValue + " but got " + actualCfValue);
} else {
reporter.serviceIsOk(MonitoredServiceKey.CF);
throw new ServiceFailureException(info, "Was expecting calculated field value " + cfTestValue + " but got " + actualCfValue);
}
}
reporter.reportLatency(Latencies.wsUpdate(getKey()), stopWatch.getTime());

Loading…
Cancel
Save