Compare commits

..

4 Commits

Author SHA1 Message Date
ralphlee
665cf5f3b8 [WIFI-7514] Fix enum handling for DHCP Lease IP table 2022-03-31 12:13:13 -04:00
ralphlee
284f9bcf37 [WIFI-7514] Adding init for DHCP lease ip table when ap connects 2022-03-29 22:56:53 -04:00
lynnshi-design
b7c6594937 WIFI-7336 OpenSync: assocClientRx should be busySelf (not busyRx) (#76)
Co-authored-by: Lynn Shi <lynn.shi@netexperience.com>
2022-03-21 13:18:49 -04:00
norm-traxler
d2c7eac05d Merge pull request #75 from Telecominfraproject/WIFI-7323
[WIFI-7323] push new config to AP only if the cloud config is more re…
2022-03-18 17:16:08 -04:00
4 changed files with 52 additions and 19 deletions

View File

@@ -520,15 +520,18 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
if (apNodeMetrics.getSourceTimestampMs() < survey.getTimestampMs())
apNodeMetrics.setSourceTimestampMs(survey.getTimestampMs());
int pctBusyTx = busyTx / totalDurationMs;
float pctBusyTx = (float)busyTx / totalDurationMs;
checkIfOutOfBound("pctBusyTx", pctBusyTx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setAssocClientTx(pctBusyTx);
int pctBusyRx = busyRx / totalDurationMs;
radioUtil.setAssocClientTx(Math.round(pctBusyTx));
float pctBusyRx = (float) busyRx / totalDurationMs;
checkIfOutOfBound("pctBusyRx", pctBusyRx, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setAssocClientRx(pctBusyRx);
float pctBusySelf = (float) busySelf / totalDurationMs;
checkIfOutOfBound("pctBusySelf", pctBusySelf, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setAssocClientRx(Math.round(pctBusySelf));
double pctIBSS = (busyTx + busySelf) / totalDurationMs;
double pctIBSS = (double) (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 {} "
@@ -538,13 +541,13 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
}
radioUtil.setIbss(pctIBSS);
int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs;
float nonWifi = (float) (busy - (busyTx + busyRx)) / totalDurationMs;
checkIfOutOfBound("nonWifi", nonWifi, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setNonWifi(nonWifi);
radioUtil.setNonWifi(Math.round(nonWifi));
int pctOBSSAndSelfErrors = (busyRx - busySelf) / totalDurationMs;
float pctOBSSAndSelfErrors = (float) (busyRx - busySelf) / totalDurationMs;
checkIfOutOfBound("OBSSAndSelfErrors", pctOBSSAndSelfErrors, survey, totalDurationMs, busyTx, busyRx, busy, busySelf);
radioUtil.setUnassocClientRx(pctOBSSAndSelfErrors);
radioUtil.setUnassocClientRx(Math.round(pctOBSSAndSelfErrors));
radioType = OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(survey.getBand());
if (radioType != RadioType.UNSUPPORTED) {
@@ -559,7 +562,7 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
}
Long totalUtilization = Math.round((double) busy / totalDurationMs);
Long totalNonWifi = totalUtilization - ((busyTx + busyRx) / totalDurationMs);
Long totalNonWifi = Math.round((double) (busy - (busyTx + busyRx)) / totalDurationMs);
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
cap.setUnavailableCapacity(totalNonWifi.intValue());
@@ -623,8 +626,8 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
alarm = alarmServiceInterface.create(alarm);
}
private void checkIfOutOfBound(String checkedType, int checkedValue, Survey survey, int totalDurationMs, int busyTx, int busyRx, int busy, int busySelf) {
if (checkedValue > 100 || checkedValue < 0) {
private void checkIfOutOfBound(String checkedType, float checkedValue, Survey survey, int totalDurationMs, int busyTx, int busyRx, int busy, int busySelf) {
if (checkedValue > 100F || checkedValue < 0F) {
LOG.warn(
"Calculated value for {} {} is out of bounds on totalDurationMs {} for survey.getBand {}. busyTx {} busyRx {} busy {} busySelf {} "
+ " survey.getTimestampMs {}, survey.getSurveyListList {}",

View File

@@ -514,12 +514,12 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
if (rowUpdate.getNew() == null) {
// delete
Map<String, String> rowMap = new HashMap<>();
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
delete.add(rowMap);
// delete
} else if (rowUpdate.getOld() == null) {
// insert
Map<String, String> rowMap = new HashMap<>();
@@ -528,15 +528,13 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
insert.add(rowMap);
} else {
// insert
// update
Map<String, String> rowMap = new HashMap<>();
rowUpdate.getOld().getColumns().putAll(rowUpdate.getNew().getColumns());
rowUpdate.getOld().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
update.add(rowMap);
}
}
}
@@ -560,7 +558,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
});
awCf.join();
extIntegrationInterface.dhcpLeasedIpDbTableUpdate(ovsdbDao.getInitialOpensyncDhcpLeasedIp(awCf.join(), key, ovsdbClient), key, RowUpdateOperation.INIT);
}
@@ -680,7 +678,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
}
});
extIntegrationInterface.wifiAssociatedClientsDbTableUpdate(ovsdbDao.getInitialOpensyncWifiAssociatedClients(acCf.join(), key, ovsdbClient), key);
}

View File

@@ -152,6 +152,11 @@ public class OvsdbDao extends OvsdbDaoBase {
OvsdbClient ovsdbClient) {
return ovsdbMonitor.getInitialOpensyncWifiAssociatedClients(join, key, ovsdbClient);
}
public List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates join, String key,
OvsdbClient ovsdbClient) {
return ovsdbMonitor.getInitialOpensyncDhcpLeasedIp(join, key, ovsdbClient);
}
public Collection<? extends OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String key,
OvsdbClient ovsdbClient) {

View File

@@ -83,6 +83,33 @@ public class OvsdbMonitor extends OvsdbDaoBase {
}
return ret;
}
List<Map<String, String>> getInitialOpensyncDhcpLeasedIp(TableUpdates tableUpdates, String apId,
OvsdbClient ovsdbClient) {
LOG.debug("getInitialOpensyncDhcpLeasedIp:");
List<Map<String, String>> ret = new ArrayList<>();
try {
LOG.debug(dhcpLeasedIpDbTable + "_" + apId + " initial monitor table state received {}",
tableUpdates);
for (TableUpdate tableUpdate : tableUpdates.getTableUpdates().values()) {
for (RowUpdate rowUpdate : tableUpdate.getRowUpdates().values()) {
if (rowUpdate.getNew() != null) {
Map<String, String> rowMap = new HashMap<>();
rowUpdate.getNew().getColumns().entrySet().forEach(c -> OvsdbDao.translateDhcpFpValueToString(c, rowMap));
ret.add(rowMap);
}
}
}
} catch (Exception e) {
throw (e);
}
return ret;
}
List<OpensyncAPInetState> getOpensyncApInetStateForRowUpdate(RowUpdate rowUpdate, String apId,
OvsdbClient ovsdbClient) {