mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 19:17:52 +00:00
Fix throughput for ClientSession, add AP Id to ovsdbClient connect/disconnect where possible
This commit is contained in:
@@ -1590,8 +1590,14 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
||||
// values reported in Kbps, convert to Mbps
|
||||
metricDetails.setRxMbps((float) (client.getStats().getRxRate() / 1000));
|
||||
metricDetails.setTxMbps((float) (client.getStats().getTxRate() / 1000));
|
||||
metricDetails.setRxRateKbps((long) client.getStats().getRxRate());
|
||||
metricDetails.setTxRateKbps((long) client.getStats().getTxRate());
|
||||
// Throughput, do rate / duration
|
||||
if (client.getDurationMs() > 0) {
|
||||
metricDetails.setRxRateKbps((long) client.getStats().getRxRate() / client.getDurationMs());
|
||||
metricDetails.setTxRateKbps((long) client.getStats().getTxRate() / client.getDurationMs());
|
||||
} else {
|
||||
LOG.info("Cannot calculate tx/rx throughput for Client {} based on duration of {} Ms",
|
||||
client.getMacAddress(), client.getDurationMs());
|
||||
}
|
||||
|
||||
return metricDetails;
|
||||
}
|
||||
|
||||
@@ -22,17 +22,20 @@ public class OvsdbSessionMap implements OvsdbSessionMapInterface {
|
||||
|
||||
@Override
|
||||
public OvsdbSession getSession(String apId) {
|
||||
LOG.info("Get session for AP {}", apId);
|
||||
return connectedClients.get(apId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OvsdbSession removeSession(String apId) {
|
||||
LOG.info("Removing session for AP {}", apId);
|
||||
return connectedClients.remove(apId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeSession(String apId) {
|
||||
try {
|
||||
LOG.info("Close session for AP {}", apId);
|
||||
connectedClients.get(apId).getOvsdbClient().shutdown();
|
||||
connectedClients.remove(apId);
|
||||
LOG.info("Closed ovsdb session for {}", apId);
|
||||
|
||||
@@ -16,11 +16,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbClientInterface;
|
||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.OpensyncExternalIntegrationInterface;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbClientInterface;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSession;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSessionMapInterface;
|
||||
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
||||
@@ -110,7 +109,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
|
||||
monitorOvsdbStateTables(ovsdbClient, key);
|
||||
|
||||
LOG.info("ovsdbClient connected from {} on port {} key {} ", remoteHost, localPort, key);
|
||||
LOG.info("ovsdbClient connected from {} on port {} AP {} ", remoteHost, localPort, key);
|
||||
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||
|
||||
} catch (IllegalStateException e) {
|
||||
@@ -162,7 +161,7 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
}
|
||||
}
|
||||
|
||||
LOG.info("ovsdbClient disconnected from {} on port {} clientCn {} key {} ", remoteHost, localPort,
|
||||
LOG.info("ovsdbClient disconnected from {} on port {} clientCn {} AP {} ", remoteHost, localPort,
|
||||
clientCn, key);
|
||||
LOG.info("ovsdbClient connectedClients = {}", ovsdbSessionMapInterface.getNumSessions());
|
||||
|
||||
@@ -182,6 +181,9 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
connectNodeInfo = ovsdbDao.updateConnectNodeInfoOnConnect(ovsdbClient, clientCn, connectNodeInfo);
|
||||
|
||||
String apId = clientCn + "_" + connectNodeInfo.serialNumber;
|
||||
|
||||
LOG.debug("Client connect for AP {}", apId);
|
||||
|
||||
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
|
||||
|
||||
try {
|
||||
@@ -608,7 +610,9 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
|
||||
ovsdbDao.configureFirmwareFlash(session.getOvsdbClient(), apId, firmwareVersion, username);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Failed to flash firmware for " + apId + " " + e.getLocalizedMessage());
|
||||
monitorOvsdbStateTables(ovsdbClient, apId); // turn back on so we can go forward and recover
|
||||
monitorOvsdbStateTables(ovsdbClient, apId); // turn back on so we
|
||||
// can go forward and
|
||||
// recover
|
||||
return "Failed to flash firmware for " + apId + " " + e.getLocalizedMessage();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user