Add log to track WIFI-1237: Radio/Channel Utilization is more than 100% (#22)

* Add log to track WIFI-1237: Radio/Channel Utilization is more than 100%

Co-authored-by: Lynn Shi <lynn.shi@netexperience.com>
This commit is contained in:
lynnshi-design
2020-12-22 15:44:59 -05:00
committed by GitHub
parent 9b83f28ab3
commit 34aba7191a

View File

@@ -1670,19 +1670,23 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
busySelf += surveySample.getBusySelf() * surveySample.getDurationMs(); busySelf += surveySample.getBusySelf() * surveySample.getDurationMs();
totalDurationMs += surveySample.getDurationMs(); totalDurationMs += surveySample.getDurationMs();
noiseList.add(getNegativeSignedIntFrom8BitUnsigned(surveySample.getNoise())); noiseList.add(getNegativeSignedIntFrom8BitUnsigned(surveySample.getNoise()));
} }
if (totalDurationMs > 0) { if (totalDurationMs > 0) {
RadioUtilization radioUtil = new RadioUtilization(); RadioUtilization radioUtil = new RadioUtilization();
radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs()) / 1000)); radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs()) / 1000));
int pctBusyTx = busyTx / totalDurationMs; int pctBusyTx = busyTx / totalDurationMs;
checkIfOutOfBound("pctBusyTx", pctBusyTx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setAssocClientTx(pctBusyTx); radioUtil.setAssocClientTx(pctBusyTx);
int pctBusyRx = busyRx / totalDurationMs; int pctBusyRx = busyRx / totalDurationMs;
checkIfOutOfBound("pctBusyRx", pctBusyRx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setAssocClientRx(pctBusyRx); radioUtil.setAssocClientRx(pctBusyRx);
double pctIBSS = (busyTx + busySelf) / totalDurationMs; double pctIBSS = (busyTx + busySelf) / totalDurationMs;
radioUtil.setIbss(pctIBSS); radioUtil.setIbss(pctIBSS);
int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs; int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs;
checkIfOutOfBound("nonWifi", nonWifi, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setNonWifi(nonWifi); radioUtil.setNonWifi(nonWifi);
radioType = OvsdbToWlanCloudTypeMappingUtility radioType = OvsdbToWlanCloudTypeMappingUtility
@@ -1709,7 +1713,6 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
apNodeMetrics.setChannelUtilization(radioType, totalUtilization.intValue()); apNodeMetrics.setChannelUtilization(radioType, totalUtilization.intValue());
capacityDetails.put(radioType, cap); capacityDetails.put(radioType, cap);
} }
} }
} }
@@ -1725,6 +1728,16 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
updateDeviceStatusRadioUtilizationReport(customerId, equipmentId, radioUtilizationReport); updateDeviceStatusRadioUtilizationReport(customerId, equipmentId, radioUtilizationReport);
} }
private void checkIfOutOfBound(String checkedType, int checkedValue, Survey survey, int totalDurationMs,
int busyTx, int busyRx, int busy, int busySelf) {
if (checkedValue > 100 || checkedValue < 0) {
LOG.warn("Calculated value for {} {} is out of bounds on totalDurationMs {} for survey.getBand {}. busyTx {} busyRx {} busy {} busySelf {} "
+ " survey.getTimestampMs {}, survey.getSurveyListList {}",
checkedType, checkedValue, totalDurationMs, survey.getBand(), busyTx, busyRx, busy, busySelf,
survey.getTimestampMs(), survey.getSurveyListList());
}
}
private void updateNetworkAdminStatusReport(int customerId, long equipmentId, ApNodeMetrics apNodeMetrics) { private void updateNetworkAdminStatusReport(int customerId, long equipmentId, ApNodeMetrics apNodeMetrics) {
apNodeMetrics.getNetworkProbeMetrics().forEach(n -> { apNodeMetrics.getNetworkProbeMetrics().forEach(n -> {