mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 11:37:49 +00:00
Change reporting interval for survey stats. Remove unwanted behaviour when apDisconnect from OpensyncExternalIntegrationCloud.java
This commit is contained in:
@@ -129,7 +129,6 @@ import com.telecominfraproject.wlan.status.equipment.report.models.RadioUtilizat
|
|||||||
import com.telecominfraproject.wlan.status.models.Status;
|
import com.telecominfraproject.wlan.status.models.Status;
|
||||||
import com.telecominfraproject.wlan.status.models.StatusCode;
|
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.models.StatusDetails;
|
|
||||||
import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData;
|
import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData;
|
||||||
|
|
||||||
import sts.OpensyncStats;
|
import sts.OpensyncStats;
|
||||||
@@ -744,11 +743,11 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
|
OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
|
||||||
|
|
||||||
if (ovsdbSession != null) {
|
if (ovsdbSession != null) {
|
||||||
if (ovsdbSession.getCustomerId() > 0 && ovsdbSession.getEquipmentId() > 0L) {
|
// if (ovsdbSession.getCustomerId() > 0 && ovsdbSession.getEquipmentId() > 0L) {
|
||||||
List<Status> statusForDisconnectedAp = statusServiceInterface.delete(ovsdbSession.getCustomerId(),
|
// List<Status> statusForDisconnectedAp = statusServiceInterface.delete(ovsdbSession.getCustomerId(),
|
||||||
ovsdbSession.getEquipmentId());
|
// ovsdbSession.getEquipmentId());
|
||||||
LOG.info("Deleted status records {} for AP {}", statusForDisconnectedAp, apId);
|
// LOG.info("Deleted status records {} for AP {}", statusForDisconnectedAp, apId);
|
||||||
}
|
// }
|
||||||
if (ovsdbSession.getRoutingId() > 0L) {
|
if (ovsdbSession.getRoutingId() > 0L) {
|
||||||
try {
|
try {
|
||||||
routingServiceInterface.delete(ovsdbSession.getRoutingId());
|
routingServiceInterface.delete(ovsdbSession.getRoutingId());
|
||||||
@@ -1542,7 +1541,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
ServiceMetric smr = new ServiceMetric(customerId, equipmentId);
|
ServiceMetric smr = new ServiceMetric(customerId, equipmentId);
|
||||||
|
|
||||||
smr.setLocationId(locationId);
|
smr.setLocationId(locationId);
|
||||||
getMacAddressForAp(customerId, equipmentId, locationId, smr);
|
|
||||||
|
|
||||||
metricRecordList.add(smr);
|
metricRecordList.add(smr);
|
||||||
smr.setDetails(apNodeMetrics);
|
smr.setDetails(apNodeMetrics);
|
||||||
@@ -2099,7 +2097,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
ServiceMetric smr = new ServiceMetric(customerId, equipmentId);
|
ServiceMetric smr = new ServiceMetric(customerId, equipmentId);
|
||||||
smr.setLocationId(locationId);
|
smr.setLocationId(locationId);
|
||||||
getMacAddressForAp(customerId, equipmentId, locationId, smr);
|
|
||||||
|
|
||||||
metricRecordList.add(smr);
|
metricRecordList.add(smr);
|
||||||
NeighbourScanReports neighbourScanReports = new NeighbourScanReports();
|
NeighbourScanReports neighbourScanReports = new NeighbourScanReports();
|
||||||
@@ -2339,7 +2336,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
smr.setLocationId(locationId);
|
smr.setLocationId(locationId);
|
||||||
ApSsidMetrics apSsidMetrics = new ApSsidMetrics();
|
ApSsidMetrics apSsidMetrics = new ApSsidMetrics();
|
||||||
|
|
||||||
getMacAddressForAp(customerId, equipmentId, locationId, smr);
|
|
||||||
|
|
||||||
smr.setDetails(apSsidMetrics);
|
smr.setDetails(apSsidMetrics);
|
||||||
metricRecordList.add(smr);
|
metricRecordList.add(smr);
|
||||||
@@ -2502,37 +2498,16 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getMacAddressForAp(int customerId, long equipmentId, long locationId,
|
|
||||||
ServiceMetric smr) {
|
|
||||||
Status equipmentProtocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId,
|
|
||||||
StatusDataType.PROTOCOL);
|
|
||||||
if (equipmentProtocolStatus != null) {
|
|
||||||
EquipmentProtocolStatusData equipmentProtocolStatusData = (EquipmentProtocolStatusData) equipmentProtocolStatus
|
|
||||||
.getDetails();
|
|
||||||
|
|
||||||
if (equipmentProtocolStatusData != null) {
|
|
||||||
if (equipmentProtocolStatusData.getReportedMacAddr() != null) {
|
|
||||||
smr.setClientMac(equipmentProtocolStatusData.getReportedMacAddr().getAddressAsLong());
|
|
||||||
} else if (equipmentProtocolStatusData.getBaseMacAddress() != null) {
|
|
||||||
smr.setClientMac(equipmentProtocolStatusData.getBaseMacAddress().getAddressAsLong());
|
|
||||||
} else {
|
|
||||||
LOG.debug("Unable to get mac address for equipment {} customer {} location {}", equipmentId,
|
|
||||||
customerId, locationId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int getNegativeSignedIntFromUnsigned(int unsignedValue) {
|
int getNegativeSignedIntFromUnsigned(int unsignedValue) {
|
||||||
int negSignedValue = (unsignedValue << 1) >> 1;
|
int negSignedValue = (unsignedValue << 1) >> 1;
|
||||||
return negSignedValue;
|
return negSignedValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getNegativeSignedIntFrom8BitUnsigned(int unsignedValue) {
|
int getNegativeSignedIntFrom8BitUnsigned(int unsignedValue) {
|
||||||
|
|
||||||
byte b = (byte) Integer.parseInt(Integer.toHexString(unsignedValue), 16);
|
byte b = (byte) Integer.parseInt(Integer.toHexString(unsignedValue), 16);
|
||||||
return b;
|
return b;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateChannelInfoReports(List<ServiceMetric> metricRecordList, Report report, int customerId,
|
private void populateChannelInfoReports(List<ServiceMetric> metricRecordList, Report report, int customerId,
|
||||||
@@ -2543,7 +2518,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
smr.setCustomerId(customerId);
|
smr.setCustomerId(customerId);
|
||||||
smr.setEquipmentId(equipmentId);
|
smr.setEquipmentId(equipmentId);
|
||||||
smr.setLocationId(locationId);
|
smr.setLocationId(locationId);
|
||||||
getMacAddressForAp(customerId, equipmentId, locationId, smr);
|
|
||||||
|
|
||||||
ChannelInfoReports channelInfoReports = new ChannelInfoReports();
|
ChannelInfoReports channelInfoReports = new ChannelInfoReports();
|
||||||
|
|
||||||
@@ -2553,20 +2527,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
for (Survey survey : report.getSurveyList()) {
|
for (Survey survey : report.getSurveyList()) {
|
||||||
|
|
||||||
smr.setCreatedTimestamp(survey.getTimestampMs());
|
smr.setCreatedTimestamp(survey.getTimestampMs());
|
||||||
// message SurveySample {
|
LOG.info("Survey {}", survey);
|
||||||
// required uint32 channel = 1;
|
|
||||||
// optional uint32 duration_ms = 2;
|
|
||||||
// optional uint32 total_count = 3;
|
|
||||||
// optional uint32 sample_count = 4;
|
|
||||||
// optional uint32 busy = 5; /* Busy = Rx + Tx + Interference */
|
|
||||||
// optional uint32 busy_tx = 6; /* Tx */
|
|
||||||
// optional uint32 busy_rx = 7; /* Rx = Rx_obss + Rx_errr (self and
|
|
||||||
// obss errors) */
|
|
||||||
// optional uint32 busy_self = 8; /* Rx_self (derived from succesful
|
|
||||||
// Rx frames)*/
|
|
||||||
// optional uint32 offset_ms = 9;
|
|
||||||
// optional uint32 busy_ext = 10; /* 40MHz extention channel busy */
|
|
||||||
// }
|
|
||||||
|
|
||||||
RadioType radioType = null;
|
RadioType radioType = null;
|
||||||
if (survey.getBand() == RadioBandType.BAND2G) {
|
if (survey.getBand() == RadioBandType.BAND2G) {
|
||||||
|
|||||||
@@ -3033,7 +3033,7 @@ public class OvsdbDao {
|
|||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
Map<String, Integer> thresholdMap = new HashMap<>();
|
Map<String, Integer> thresholdMap = new HashMap<>();
|
||||||
thresholdMap.put("max_delay", 600);
|
thresholdMap.put("max_delay", 600);
|
||||||
thresholdMap.put("util", 10);
|
thresholdMap.put("util", 25);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
com.vmware.ovsdb.protocol.operation.notation.Map<String, Integer> thresholds = com.vmware.ovsdb.protocol.operation.notation.Map
|
com.vmware.ovsdb.protocol.operation.notation.Map<String, Integer> thresholds = com.vmware.ovsdb.protocol.operation.notation.Map
|
||||||
@@ -3139,7 +3139,7 @@ public class OvsdbDao {
|
|||||||
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
||||||
rowColumns.put("reporting_interval", new Atom<>(60));
|
rowColumns.put("reporting_interval", new Atom<>(60));
|
||||||
rowColumns.put("report_type", new Atom<>("raw"));
|
rowColumns.put("report_type", new Atom<>("raw"));
|
||||||
rowColumns.put("sampling_interval", new Atom<>(6));
|
rowColumns.put("sampling_interval", new Atom<>(10));
|
||||||
rowColumns.put("stats_type", new Atom<>("survey"));
|
rowColumns.put("stats_type", new Atom<>("survey"));
|
||||||
rowColumns.put("survey_interval_ms", new Atom<>(65));
|
rowColumns.put("survey_interval_ms", new Atom<>(65));
|
||||||
rowColumns.put("survey_type", new Atom<>("on-chan"));
|
rowColumns.put("survey_type", new Atom<>("on-chan"));
|
||||||
@@ -3166,11 +3166,11 @@ public class OvsdbDao {
|
|||||||
rowColumns.put("channel_list", channels);
|
rowColumns.put("channel_list", channels);
|
||||||
|
|
||||||
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
rowColumns.put("radio_type", new Atom<>(rc.freqBand));
|
||||||
rowColumns.put("reporting_interval", new Atom<>(60));
|
rowColumns.put("reporting_interval", new Atom<>(300));
|
||||||
|
rowColumns.put("report_type", new Atom<>("raw"));
|
||||||
rowColumns.put("stats_type", new Atom<>("survey"));
|
rowColumns.put("stats_type", new Atom<>("survey"));
|
||||||
rowColumns.put("survey_type", new Atom<>("off-chan"));
|
rowColumns.put("survey_type", new Atom<>("off-chan"));
|
||||||
rowColumns.put("report_type", new Atom<>("raw"));
|
rowColumns.put("sampling_interval", new Atom<>(30));
|
||||||
rowColumns.put("sampling_interval", new Atom<>(60));
|
|
||||||
rowColumns.put("survey_interval_ms", new Atom<>(65));
|
rowColumns.put("survey_interval_ms", new Atom<>(65));
|
||||||
rowColumns.put("threshold", thresholds);
|
rowColumns.put("threshold", thresholds);
|
||||||
Row updateRow = new Row(rowColumns);
|
Row updateRow = new Row(rowColumns);
|
||||||
|
|||||||
Reference in New Issue
Block a user