mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-20 11:54:58 +00:00
WIFI-780: Change Opensync Gateway to process RF survey data as percentile data
Change ChannelInfo reports to reflect Survey data showing percentage values for samples. ApNode report still being addressed.
This commit is contained in:
@@ -1425,7 +1425,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
int oBSS = 0;
|
int oBSS = 0;
|
||||||
int iBSS = 0;
|
int iBSS = 0;
|
||||||
int totalBusy = 0;
|
int totalBusy = 0;
|
||||||
int durationMs = 0;
|
int totalDurationMs = 0;
|
||||||
RadioType radioType = RadioType.UNSUPPORTED;
|
RadioType radioType = RadioType.UNSUPPORTED;
|
||||||
|
|
||||||
List<Integer> noiseList = new ArrayList<>();
|
List<Integer> noiseList = new ArrayList<>();
|
||||||
@@ -1434,19 +1434,19 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
iBSS += surveySample.getBusySelf() + surveySample.getBusyTx();
|
// we need to perform a weighted average here because the
|
||||||
oBSS += surveySample.getBusyRx();
|
// samples are in percentage, and may be of different durations
|
||||||
totalBusy += surveySample.getBusy();
|
iBSS += (surveySample.getBusySelf() + surveySample.getBusyTx()) * surveySample.getDurationMs();
|
||||||
durationMs += surveySample.getDurationMs();
|
oBSS += surveySample.getBusyRx() * surveySample.getDurationMs();
|
||||||
|
totalBusy += surveySample.getBusy() * surveySample.getDurationMs();
|
||||||
|
totalDurationMs += surveySample.getDurationMs();
|
||||||
noiseList.add(getNegativeSignedIntFrom8BitUnsigned(surveySample.getNoise()));
|
noiseList.add(getNegativeSignedIntFrom8BitUnsigned(surveySample.getNoise()));
|
||||||
RadioUtilization radioUtil = new RadioUtilization();
|
RadioUtilization radioUtil = new RadioUtilization();
|
||||||
radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000));
|
radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000));
|
||||||
radioUtil.setAssocClientTx((100 * surveySample.getBusyTx()) / surveySample.getDurationMs());
|
radioUtil.setAssocClientTx(surveySample.getBusyTx());
|
||||||
radioUtil.setAssocClientRx((100 * surveySample.getBusyRx()) / surveySample.getDurationMs());
|
radioUtil.setAssocClientRx(surveySample.getBusySelf());
|
||||||
// TODO not totally correct, NonWifi = totalBusy - iBSS - oBSS
|
// TODO not totally correct, NonWifi = totalBusy - iBSS - oBSS
|
||||||
radioUtil.setNonWifi(
|
radioUtil.setNonWifi(surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusySelf());
|
||||||
(100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx()))
|
|
||||||
/ surveySample.getDurationMs());
|
|
||||||
|
|
||||||
switch (survey.getBand()) {
|
switch (survey.getBand()) {
|
||||||
case BAND2G:
|
case BAND2G:
|
||||||
@@ -1480,20 +1480,22 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
avgNoiseFloor.put(radioType, noiseAvg);
|
avgNoiseFloor.put(radioType, noiseAvg);
|
||||||
apNodeMetrics.setNoiseFloor(radioType, noiseAvg);
|
apNodeMetrics.setNoiseFloor(radioType, noiseAvg);
|
||||||
}
|
}
|
||||||
Double totalUtilization = (100D * totalBusy) / durationMs;
|
if (totalDurationMs > 0) {
|
||||||
Double totalNonWifi = (100D * (totalBusy - iBSS - oBSS)) / durationMs;
|
Long totalUtilization = Math.round((double) totalBusy / totalDurationMs);
|
||||||
|
Long totalNonWifi = Math.round((double) totalBusy - (double) iBSS - (double) oBSS / totalDurationMs);
|
||||||
|
|
||||||
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
|
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
|
||||||
cap.setUnavailableCapacity(totalNonWifi.intValue());
|
cap.setUnavailableCapacity(totalNonWifi.intValue());
|
||||||
int avaiCapacity = 100 - totalNonWifi.intValue();
|
int avaiCapacity = 100 - totalNonWifi.intValue();
|
||||||
cap.setAvailableCapacity(avaiCapacity);
|
cap.setAvailableCapacity(avaiCapacity);
|
||||||
cap.setUsedCapacity(totalUtilization.intValue());
|
cap.setUsedCapacity(totalUtilization.intValue());
|
||||||
cap.setUnusedCapacity(avaiCapacity - totalUtilization.intValue());
|
cap.setUnusedCapacity(avaiCapacity - totalUtilization.intValue());
|
||||||
cap.setTotalCapacity(100);
|
cap.setTotalCapacity(100);
|
||||||
|
|
||||||
if (radioType != RadioType.UNSUPPORTED) {
|
if (radioType != RadioType.UNSUPPORTED) {
|
||||||
apNodeMetrics.setChannelUtilization(radioType, totalUtilization.intValue());
|
apNodeMetrics.setChannelUtilization(radioType, totalUtilization.intValue());
|
||||||
capacityDetails.put(radioType, cap);
|
capacityDetails.put(radioType, cap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2147,31 +2149,34 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
|
|
||||||
ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList,
|
ChannelInfo createChannelInfo(long equipmentId, RadioType radioType, List<SurveySample> surveySampleList,
|
||||||
ChannelBandwidth channelBandwidth) {
|
ChannelBandwidth channelBandwidth) {
|
||||||
|
|
||||||
|
LOG.debug("createChannelInfo::SurveySampleList {}", surveySampleList);
|
||||||
|
|
||||||
int busyTx = 0; /* Tx */
|
int busyTx = 0; /* Tx */
|
||||||
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
||||||
int busy = 0; /* Busy = Rx + Tx + Interference */
|
int busy = 0; /* Busy = Rx + Tx + Interference */
|
||||||
long durationMs = 0;
|
long totalDurationMs = 0;
|
||||||
ChannelInfo channelInfo = new ChannelInfo();
|
ChannelInfo channelInfo = new ChannelInfo();
|
||||||
|
|
||||||
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() * sample.getDurationMs();
|
||||||
busyTx += sample.getBusyTx();
|
busySelf += sample.getBusySelf() * sample.getDurationMs(); // successful
|
||||||
busySelf += sample.getBusySelf(); // successful Rx
|
// Rx
|
||||||
busy += sample.getBusy();
|
busy += sample.getBusy() * sample.getDurationMs();
|
||||||
channelInfo.setChanNumber(sample.getChannel());
|
channelInfo.setChanNumber(sample.getChannel());
|
||||||
noiseArray[index++] = getNegativeSignedIntFrom8BitUnsigned(sample.getNoise());
|
noiseArray[index++] = getNegativeSignedIntFrom8BitUnsigned(sample.getNoise());
|
||||||
durationMs += sample.getDurationMs();
|
totalDurationMs += sample.getDurationMs();
|
||||||
}
|
}
|
||||||
|
|
||||||
int iBSS = busyTx + busySelf;
|
int iBSS = busyTx + busySelf;
|
||||||
|
|
||||||
Double totalUtilization = (100D * busy) / durationMs;
|
Long totalUtilization = Math.round((double) busy / totalDurationMs);
|
||||||
Double totalNonWifi = (100D * (busy - iBSS )) / durationMs;
|
Long totalNonWifi = Math.round(((double) busy - (double) iBSS) / totalDurationMs);
|
||||||
|
|
||||||
channelInfo.setTotalUtilization(totalUtilization.intValue());
|
channelInfo.setTotalUtilization(totalUtilization.intValue());
|
||||||
channelInfo.setWifiUtilization(totalUtilization.intValue()- totalNonWifi.intValue());
|
channelInfo.setWifiUtilization(totalUtilization.intValue() - totalNonWifi.intValue());
|
||||||
channelInfo.setBandwidth(channelBandwidth);
|
channelInfo.setBandwidth(channelBandwidth);
|
||||||
if (surveySampleList.size() > 0) {
|
if (surveySampleList.size() > 0) {
|
||||||
channelInfo.setNoiseFloor((int) Math.round(DecibelUtils.getAverageDecibel(noiseArray)));
|
channelInfo.setNoiseFloor((int) Math.round(DecibelUtils.getAverageDecibel(noiseArray)));
|
||||||
|
|||||||
Reference in New Issue
Block a user