diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java index c5d7994..07c826e 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java @@ -1126,13 +1126,21 @@ public class MqttStatsPublisher implements StatsPublisherInterface { checkIfOutOfBound("pctBusyTx", pctBusyTx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf); radioUtil.setAssocClientTx(pctBusyTx); - int pctBusyRx = busyRx / totalDurationMs; + int pctBusyRx = busySelf / totalDurationMs; checkIfOutOfBound("pctBusyRx", pctBusyRx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf); radioUtil.setAssocClientRx(pctBusyRx); - double pctIBSS = (busyTx + busySelf) / totalDurationMs; + double pctIBSS = (busyTx + busySelf) / totalDurationMs; + if (pctIBSS > 100D || pctIBSS < 0D) { + LOG.warn( + "Calculated value for {} {} is out of bounds on totalDurationMs {} for survey.getBand {}. busyTx {} busyRx {} busy {} busySelf {} " + + " survey.getTimestampMs {}, survey.getSurveyListList {}", + "pctIBSS", pctIBSS, totalDurationMs, survey.getBand(), busyTx, busyRx, busy, busySelf, survey.getTimestampMs(), + survey.getSurveyListList()); + } radioUtil.setIbss(pctIBSS); - int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs; + + int nonWifi = (busy - busyTx - busySelf) / totalDurationMs; checkIfOutOfBound("nonWifi", nonWifi, survey, totalDurationMs, busyTx, busyRx, busy, busySelf); radioUtil.setNonWifi(nonWifi);