Move the raising and clearing of the threshold alarms into the gateway controller when the device information is received in the MQTT device report. Update EquipmentAdminState alarms or clear if required.

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
This commit is contained in:
Mike Hansen
2021-06-22 12:31:30 -04:00
parent 5a98d4bd83
commit bda589e65e

View File

@@ -989,7 +989,7 @@ public class MqttStatsPublisher {
if (deviceReport.hasMemUtil() && deviceReport.getMemUtil().hasMemTotal() && deviceReport.getMemUtil().hasMemUsed()) {
apPerformance.setFreeMemory(deviceReport.getMemUtil().getMemTotal() - deviceReport.getMemUtil().getMemUsed());
if (deviceReport.getMemUtil().getMemUsed()/deviceReport.getMemUtil().getMemTotal() > memoryUtilThresholdPct) {
if (deviceReport.getMemUtil().getMemUsed()/deviceReport.getMemUtil().getMemTotal() * 100 > memoryUtilThresholdPct) {
raiseDeviceThresholdAlarm(customerId, equipmentId, AlarmCode.MemoryUtilization, deviceReport.getTimestampMs());
} else {
// Clear any existing cpuUtilization alarms