WIFI-638: Reported Noise floor looks inaccurate

Should have noise floor sent as a signed value, is currently coming as an uint32
I believe the AP actually translates the signed value to that.
ON channel reports more than just the channel in use on the radio which is making a mess as well, I have added a filter on the OSGW as a workaround which will prevent OFF channel values being used during calculation of channel info for on channel reporting. This may become unnecessary when the AP fix comes in but for now might clear things up a bit. After we change to a signed value, combined with correct channel survey reporting, we should have a better value.
This commit is contained in:
Mike Hansen
2020-09-02 17:19:37 -04:00
parent 3e46874a6c
commit cea90c48d3

View File

@@ -2,9 +2,7 @@ package com.telecominfraproject.wlan.opensync.external.integration;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@@ -133,7 +131,6 @@ import com.telecominfraproject.wlan.status.models.StatusCode;
import com.telecominfraproject.wlan.status.models.StatusDataType; import com.telecominfraproject.wlan.status.models.StatusDataType;
import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData; import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData;
import javassist.bytecode.ByteArray;
import sts.OpensyncStats; import sts.OpensyncStats;
import sts.OpensyncStats.AssocType; import sts.OpensyncStats.AssocType;
import sts.OpensyncStats.Client; import sts.OpensyncStats.Client;
@@ -2514,91 +2511,76 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
long equipmentId, long locationId) { long equipmentId, long locationId) {
LOG.debug("populateChannelInfoReports for Customer {} Equipment {}", customerId, equipmentId); LOG.debug("populateChannelInfoReports for Customer {} Equipment {}", customerId, equipmentId);
ServiceMetric smr = new ServiceMetric();
smr.setCustomerId(customerId);
smr.setEquipmentId(equipmentId);
smr.setLocationId(locationId);
ChannelInfoReports channelInfoReports = new ChannelInfoReports();
smr.setDetails(channelInfoReports);
metricRecordList.add(smr);
for (Survey survey : report.getSurveyList()) { for (Survey survey : report.getSurveyList()) {
smr.setCreatedTimestamp(survey.getTimestampMs()); ServiceMetric smr = new ServiceMetric();
LOG.info("Survey {}", survey); smr.setCustomerId(customerId);
smr.setEquipmentId(equipmentId);
smr.setLocationId(locationId);
ChannelInfoReports channelInfoReports = new ChannelInfoReports();
Map<RadioType, List<ChannelInfo>> channelInfoMap = channelInfoReports
.getChannelInformationReportsPerRadio();
RadioType radioType = null; RadioType radioType = null;
if (survey.getBand() == RadioBandType.BAND2G) {
radioType = RadioType.is2dot4GHz; if (survey.hasBand()) {
} else if (survey.getBand() == RadioBandType.BAND5G) { radioType = getRadioTypeFromOpensyncRadioBand(survey.getBand());
radioType = RadioType.is5GHz; } else {
} else if (survey.getBand() == RadioBandType.BAND5GL) { continue;
radioType = RadioType.is5GHzL;
} else if (survey.getBand() == RadioBandType.BAND5GU) {
radioType = RadioType.is5GHzU;
} }
ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId) ChannelBandwidth channelBandwidth = ((ApElementConfiguration) equipmentServiceInterface.get(equipmentId)
.getDetails()).getRadioMap().get(radioType).getChannelBandwidth(); .getDetails()).getRadioMap().get(radioType).getChannelBandwidth();
if (survey.getSurveyType().equals(SurveyType.OFF_CHANNEL) Map<Integer, List<SurveySample>> sampleByChannelMap = new HashMap<>();
|| survey.getSurveyType().equals(SurveyType.FULL)) {
// in this case, we have multiple channels (potentially) and survey.getSurveyListList().stream().filter(new Predicate<SurveySample>() {
// will make
// ChannelInfo entries per surveyed channel
Map<Integer, List<SurveySample>> sampleByChannelMap = new HashMap<>();
survey.getSurveyListList().stream().forEach(s -> { @Override
List<SurveySample> surveySampleList; public boolean test(SurveySample t) {
if (sampleByChannelMap.get(s.getChannel()) == null) { if (survey.getSurveyType().equals(SurveyType.ON_CHANNEL)) {
surveySampleList = new ArrayList<>(); return t.hasDurationMs() && t.getDurationMs() > 0 && t.hasChannel() && t.hasBusy()
&& t.hasBusyTx() && t.hasNoise();
} else { } else {
surveySampleList = sampleByChannelMap.get(s.getChannel()); return t.hasDurationMs() && t.hasChannel();
} }
surveySampleList.add(s);
sampleByChannelMap.put(s.getChannel(), surveySampleList);
});
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList,
channelBandwidth);
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
if (channelInfoList == null) {
channelInfoList = new ArrayList<>();
}
channelInfoList.add(channelInfo);
Map<RadioType, List<ChannelInfo>> channelInfoMap = channelInfoReports
.getChannelInformationReportsPerRadio();
channelInfoMap.put(radioType, channelInfoList);
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
} }
} else { }).forEach(s -> {
List<SurveySample> surveySampleList;
List<SurveySample> surveySampleList = survey.getSurveyListList(); if (sampleByChannelMap.get(s.getChannel()) == null) {
surveySampleList = new ArrayList<>();
} else {
surveySampleList = sampleByChannelMap.get(s.getChannel());
}
surveySampleList.add(s);
sampleByChannelMap.put(s.getChannel(), surveySampleList);
});
for (List<SurveySample> surveySampleList : sampleByChannelMap.values()) {
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth); ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth);
if (LOG.isTraceEnabled()) {
LOG.trace("ChannelInfo for Survey {}", channelInfo.toPrettyString());
}
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType); List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
if (channelInfoList == null) { if (channelInfoList == null) {
channelInfoList = new ArrayList<>(); channelInfoList = new ArrayList<>();
} }
channelInfoList.add(channelInfo); channelInfoList.add(channelInfo);
Map<RadioType, List<ChannelInfo>> channelInfoMap = channelInfoReports
.getChannelInformationReportsPerRadio();
channelInfoMap.put(radioType, channelInfoList); channelInfoMap.put(radioType, channelInfoList);
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap); channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
} }
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
smr.setDetails(channelInfoReports);
smr.setCreatedTimestamp(survey.getTimestampMs());
metricRecordList.add(smr);
LOG.debug("ChannelInfoReports {}", channelInfoReports);
} }
LOG.debug("ChannelInfoReports {}", channelInfoReports);
} }
@@ -2612,7 +2594,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
int[] noiseArray = new int[surveySampleList.size()]; int[] noiseArray = new int[surveySampleList.size()];
int index = 0; int index = 0;
for (SurveySample sample : surveySampleList) { for (SurveySample sample : surveySampleList) {
LOG.debug("createChannelInfo::SurveySample {}", sample);
busyTx += sample.getBusyTx(); busyTx += sample.getBusyTx();
busySelf += sample.getBusySelf(); busySelf += sample.getBusySelf();
busy += sample.getBusy(); busy += sample.getBusy();
@@ -2632,7 +2614,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
} }
return channelInfo; return channelInfo;
} }
@Override @Override
public void processMqttMessage(String topic, FlowReport flowReport) { public void processMqttMessage(String topic, FlowReport flowReport) {