mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 11:07:49 +00:00
NoiseFloor from survey now used, default wan name set to br-wan, RadioUtilization reporting in ApNode metrics
This commit is contained in:
@@ -888,7 +888,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
gatewayController.updateActiveCustomer(customerId);
|
||||
|
||||
Equipment ce = getCustomerEquipment(apId);
|
||||
if(ce == null) {
|
||||
if (ce == null) {
|
||||
LOG.warn("Cannot read equipment {}", apId);
|
||||
return;
|
||||
}
|
||||
@@ -897,11 +897,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
|
||||
List<ServiceMetric> metricRecordList = new ArrayList<>();
|
||||
|
||||
populateApClientMetrics(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateApNodeMetrics(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateNeighbourScanReports(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
try {
|
||||
// TODO: depends on survey
|
||||
populateApClientMetrics(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateApNodeMetrics(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateNeighbourScanReports(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateChannelInfoReports(metricRecordList, report, customerId, equipmentId, locationId);
|
||||
populateApSsidMetrics(metricRecordList, report, customerId, equipmentId, apId, locationId);
|
||||
// handleRssiMetrics(metricRecordList, report, customerId,
|
||||
@@ -912,6 +911,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
}
|
||||
|
||||
if (!metricRecordList.isEmpty()) {
|
||||
LOG.debug("Publishing Metrics {}", metricRecordList);
|
||||
equipmentMetricsCollectorInterface.publishMetrics(metricRecordList);
|
||||
}
|
||||
|
||||
@@ -1082,9 +1082,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
|
||||
apNodeMetrics.setClientMacAddresses(radioType, clientMacList);
|
||||
|
||||
// TODO: temporary solution as this was causing Noise Floor to
|
||||
// disappear from Dashboard and Access Point rows
|
||||
apNodeMetrics.setNoiseFloor(radioType, -98);
|
||||
// TODO: Radio Utilization will be calculated when the survey is
|
||||
// enabled
|
||||
|
||||
@@ -1127,6 +1124,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
int iBSS = 0;
|
||||
int totalBusy = 0;
|
||||
int durationMs = 0;
|
||||
int noise = 0;
|
||||
RadioType radioType = RadioType.UNSUPPORTED;
|
||||
|
||||
for (SurveySample surveySample : survey.getSurveyListList()) {
|
||||
if (surveySample.getDurationMs() == 0) {
|
||||
continue;
|
||||
@@ -1136,7 +1136,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
oBSS += surveySample.getBusyRx();
|
||||
totalBusy += surveySample.getBusy();
|
||||
durationMs += surveySample.getDurationMs();
|
||||
|
||||
noise += surveySample.getNoise();
|
||||
RadioUtilization radioUtil = new RadioUtilization();
|
||||
radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs() + surveySample.getOffsetMs()) / 1000));
|
||||
radioUtil.setAssocClientTx((100 * surveySample.getBusyTx()) / surveySample.getDurationMs());
|
||||
@@ -1145,7 +1145,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
(100 * (surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusyRx()))
|
||||
/ surveySample.getDurationMs());
|
||||
|
||||
RadioType radioType = RadioType.UNSUPPORTED;
|
||||
switch (survey.getBand()) {
|
||||
case BAND2G:
|
||||
radioType = RadioType.is2dot4GHz;
|
||||
@@ -1161,10 +1160,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
break;
|
||||
}
|
||||
|
||||
apNodeMetrics.getRadioUtilization(radioType).add(radioUtil);
|
||||
if (radioType != RadioType.UNSUPPORTED) {
|
||||
|
||||
if (!apNodeMetrics.getRadioUtilizationPerRadio().containsKey(radioType)) {
|
||||
List<RadioUtilization> radioUtilizationList = new ArrayList<>();
|
||||
radioUtilizationList.add(radioUtil);
|
||||
apNodeMetrics.getRadioUtilizationPerRadio().put(radioType, radioUtilizationList);
|
||||
} else {
|
||||
apNodeMetrics.getRadioUtilizationPerRadio().get(radioType).add(radioUtil);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (survey.getSurveyListCount() > 0 && radioType != RadioType.UNSUPPORTED) {
|
||||
apNodeMetrics.setNoiseFloor(radioType, noise / survey.getSurveyListCount());
|
||||
}
|
||||
Double totalUtilization = (100D * totalBusy) / durationMs;
|
||||
if (survey.getBand() == RadioBandType.BAND2G) { //
|
||||
apNodeMetrics.setChannelUtilization(RadioType.is2dot4GHz, totalUtilization.intValue());
|
||||
@@ -1829,7 +1841,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
channelInfoList = new ArrayList<>();
|
||||
}
|
||||
channelInfoList.add(channelInfo);
|
||||
channelInfoReports.getChannelInformationReportsPerRadio().put(radioType, channelInfoList);
|
||||
Map<RadioType,List<ChannelInfo>> channelInfoMap = channelInfoReports.getChannelInformationReportsPerRadio();
|
||||
channelInfoMap.put(radioType, channelInfoList);
|
||||
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -1837,13 +1851,15 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
List<SurveySample> surveySampleList = survey.getSurveyListList();
|
||||
|
||||
ChannelInfo channelInfo = createChannelInfo(equipmentId, radioType, surveySampleList, channelBandwidth);
|
||||
|
||||
LOG.debug("ChannelInfo for Survey {}", channelInfo.toPrettyString());
|
||||
List<ChannelInfo> channelInfoList = channelInfoReports.getRadioInfo(radioType);
|
||||
if (channelInfoList == null) {
|
||||
channelInfoList = new ArrayList<>();
|
||||
}
|
||||
channelInfoList.add(channelInfo);
|
||||
channelInfoReports.getChannelInformationReportsPerRadio().put(radioType, channelInfoList);
|
||||
Map<RadioType,List<ChannelInfo>> channelInfoMap = channelInfoReports.getChannelInformationReportsPerRadio();
|
||||
channelInfoMap.put(radioType, channelInfoList);
|
||||
channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1858,13 +1874,15 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
int busySelf = 0; /* Rx_self (derived from succesful Rx frames) */
|
||||
int busy = 0; /* Busy = Rx + Tx + Interference */
|
||||
ChannelInfo channelInfo = new ChannelInfo();
|
||||
int noise = 0;
|
||||
|
||||
for (SurveySample sample : surveySampleList) {
|
||||
|
||||
|
||||
busyTx += sample.getBusyTx();
|
||||
busySelf += sample.getBusySelf();
|
||||
busy += sample.getBusy();
|
||||
channelInfo.setChanNumber(sample.getChannel());
|
||||
noise += sample.getNoise();
|
||||
}
|
||||
|
||||
int iBSS = busyTx + busySelf;
|
||||
@@ -1874,9 +1892,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
channelInfo.setTotalUtilization(busy);
|
||||
channelInfo.setWifiUtilization(totalWifi);
|
||||
channelInfo.setBandwidth(channelBandwidth);
|
||||
channelInfo.setNoiseFloor(-84); // TODO: when this
|
||||
// becomes available
|
||||
// add
|
||||
if (surveySampleList.size() > 0) {
|
||||
channelInfo.setNoiseFloor(noise / surveySampleList.size());
|
||||
}
|
||||
return channelInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,12 +107,12 @@ public class OvsdbDao {
|
||||
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_lan_type:bridge}")
|
||||
public String defaultLanInterfaceType;
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_lan_type:lan}")
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_lan_name:br-lan}")
|
||||
public String defaultLanInterfaceName;
|
||||
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_type:eth}")
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_type:bridge}")
|
||||
public String defaultWanInterfaceType;
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_name:eth1}")
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_wan_name:br-wan}")
|
||||
public String defaultWanInterfaceName;
|
||||
|
||||
@org.springframework.beans.factory.annotation.Value("${tip.wlan.ovsdb.wifi-iface.default_radio2g:home-ap-24}")
|
||||
@@ -218,11 +218,10 @@ public class OvsdbDao {
|
||||
|
||||
// now populate macAddress, ipV4Address from Wifi_Inet_State
|
||||
// first look them up for if_name = br-wan
|
||||
fillInWanIpAddressAndMac(ovsdbClient, ret, defaultWanInterfaceType);
|
||||
fillInWanIpAddressAndMac(ovsdbClient, ret, defaultWanInterfaceType, defaultWanInterfaceName);
|
||||
if ((ret.ipV4Address == null) || (ret.macAddress == null)) {
|
||||
// when not found - look them up for if_name = br-lan
|
||||
fillInWanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType);
|
||||
|
||||
fillInWanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType, defaultLanInterfaceName);
|
||||
}
|
||||
fillInLanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType);
|
||||
|
||||
@@ -385,6 +384,7 @@ public class OvsdbDao {
|
||||
columns.add("if_name");
|
||||
|
||||
conditions.add(new Condition("if_type", Function.EQUALS, new Atom<>(ifType)));
|
||||
conditions.add(new Condition("if_name", Function.EQUALS, new Atom<>(defaultLanInterfaceName)));
|
||||
|
||||
operations.add(new Select(wifiInetStateDbTable, conditions, columns));
|
||||
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
||||
@@ -417,7 +417,7 @@ public class OvsdbDao {
|
||||
|
||||
}
|
||||
|
||||
public void fillInWanIpAddressAndMac(OvsdbClient ovsdbClient, ConnectNodeInfo connectNodeInfo, String ifType) {
|
||||
public void fillInWanIpAddressAndMac(OvsdbClient ovsdbClient, ConnectNodeInfo connectNodeInfo, String ifType, String ifName) {
|
||||
try {
|
||||
List<Operation> operations = new ArrayList<>();
|
||||
List<Condition> conditions = new ArrayList<>();
|
||||
@@ -430,6 +430,8 @@ public class OvsdbDao {
|
||||
columns.add("if_type");
|
||||
|
||||
conditions.add(new Condition("if_type", Function.EQUALS, new Atom<>(ifType)));
|
||||
conditions.add(new Condition("if_name", Function.EQUALS, new Atom<>(ifName)));
|
||||
|
||||
|
||||
operations.add(new Select(wifiInetStateDbTable, conditions, columns));
|
||||
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
||||
@@ -2226,7 +2228,7 @@ public class OvsdbDao {
|
||||
}
|
||||
}
|
||||
|
||||
public void configureSingleSsid(OvsdbClient ovsdbClient, String ifName, String ssid, boolean ssidBroadcast,
|
||||
public void configureSingleSsid(OvsdbClient ovsdbClient, String ifName,String ssid, boolean ssidBroadcast,
|
||||
Map<String, String> security, String radioFreqBand, int vlanId, boolean rrmEnabled, boolean enable80211r, int mobilityDomain,
|
||||
boolean enable80211v, String minHwMode, boolean enabled, int keyRefresh, boolean uapsdEnabled,
|
||||
boolean apBridge, NetworkForwardMode networkForwardMode, String gateway, String inet,
|
||||
@@ -2241,8 +2243,7 @@ public class OvsdbDao {
|
||||
updateColumns.put("bridge", new Atom<>("lan"));
|
||||
} else {
|
||||
updateColumns.put("bridge", new Atom<>("wan"));
|
||||
}
|
||||
|
||||
}
|
||||
if (enable80211v) {
|
||||
updateColumns.put("btm", new Atom<>(1));
|
||||
} else {
|
||||
@@ -2441,7 +2442,7 @@ public class OvsdbDao {
|
||||
|
||||
List<RadioType> enabledRadiosFromAp = new ArrayList<>();
|
||||
getEnabledRadios(ovsdbClient, enabledRadiosFromAp);
|
||||
|
||||
|
||||
for (Profile ssidProfile : opensyncApConfig.getSsidProfile()) {
|
||||
|
||||
SsidConfiguration ssidConfig = (SsidConfiguration) ssidProfile.getDetails();
|
||||
@@ -2597,6 +2598,8 @@ public class OvsdbDao {
|
||||
// '-2' etc.
|
||||
ifName = ifName + "-" + numberOfInterfaces;
|
||||
}
|
||||
|
||||
|
||||
|
||||
configureSingleSsid(ovsdbClient, ifName, ssidConfig.getSsid(), ssidBroadcast, security, freqBand,
|
||||
ssidConfig.getVlanId(), rrmEnabled, enable80211r, mobilityDomain, enable80211v, minHwMode, enabled,
|
||||
|
||||
Reference in New Issue
Block a user