diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java index 96b81d0..3f7a01d 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationCloud.java @@ -210,8 +210,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra Profile ssidProfile = new Profile(); ssidProfile.setCustomerId(ce.getCustomerId()); - ssidProfile.setName("DefaultSsid"); + ssidProfile.setName("DefaultSsid-2g"); SsidConfiguration ssidConfig = SsidConfiguration.createWithDefaults(); + ssidConfig.setSsid("DefaultSsid-2g"); ssidConfig.setSecureMode(SecureMode.wpa2PSK); ssidConfig.setKeyStr("12345678"); Set appliedRadios = new HashSet<>(); @@ -222,9 +223,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra Profile ssidProfile5g = new Profile(); ssidProfile5g.setCustomerId(ce.getCustomerId()); - ssidProfile5g.setName("DefaultSsid-5"); + ssidProfile5g.setName("DefaultSsid-5g"); SsidConfiguration ssidConfig5g = SsidConfiguration.createWithDefaults(); ssidConfig5g.setSecureMode(SecureMode.wpa2PSK); + ssidConfig5g.setSsid("DefaultSsid-5g"); ssidConfig5g.setKeyStr("12345678"); Set appliedRadios5g = new HashSet<>(); appliedRadios5g.add(RadioType.is5GHzL); @@ -580,6 +582,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra ApNodeMetrics apNodeMetrics = null; for (Device deviceReport : report.getDeviceList()) { +// LOG.debug("Opensync Stats for Device {}", deviceReport); ServiceMetric smr = new ServiceMetric(customerId, equipmentId); metricRecordList.add(smr); @@ -758,6 +761,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra LOG.debug("populateApClientMetrics for Customer {} Equipment {}", customerId, equipmentId); for (ClientReport clReport : report.getClientsList()) { + LOG.debug("Opensync Stats for ClientReport {}", clReport); for (Client cl : clReport.getClientListList()) { @@ -869,6 +873,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra private void populateNeighbourScanReports(List metricRecordList, Report report, int customerId, long equipmentId) { LOG.debug("populateNeighbourScanReports for Customer {} Equipment {}", customerId, equipmentId); + LOG.debug("Opensync Stats for Neighbors {}", report.getNeighborsList()); for (Neighbor neighbor : report.getNeighborsList()) { @@ -926,7 +931,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra } } - private void handleClientSessionUpdate(int customerId, long equipmentId, String apId, long locationId, int channel, + private void handleClientSessionUpdate(int customerId, long equipmentId, String apId, long locationId, int channel, RadioBandType band, long timestamp, sts.PlumeStats.Client client) { com.telecominfraproject.wlan.client.models.Client clientInstance = clientServiceInterface.getOrNull(customerId, @@ -1017,10 +1022,11 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra ServiceMetric smr = new ServiceMetric(customerId, equipmentId); ApSsidMetrics apSsidMetrics = new ApSsidMetrics(); - //we need to populate location Id on the client sessions, that's why we're getting equipment object in here (from the cache) + // we need to populate location Id on the client sessions, that's why we're + // getting equipment object in here (from the cache) Equipment equipment = getCustomerEquipment(apId); - long locationId = (equipment != null) ? equipment.getLocationId() : 0 ; - + long locationId = (equipment != null) ? equipment.getLocationId() : 0; + smr.setDetails(apSsidMetrics); LOG.debug("ApSsidMetrics Keys {}: ", apSsidMetrics.getSsidStats().keySet()); metricRecordList.add(smr); @@ -1029,6 +1035,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra LOG.debug("ClientReport for channel {} RadioBand {}", clientReport.getChannel(), clientReport.getBand()); + if (smr.getCreatedTimestamp() < clientReport.getTimestampMs()) { + smr.setCreatedTimestamp(clientReport.getTimestampMs()); + } + long txBytes = 0; long rxBytes = 0; int txErrors = 0; @@ -1205,6 +1215,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra busySelf += sample.getBusySelf(); busy += sample.getBusy(); channelInfo.setChanNumber(sample.getChannel()); + LOG.debug("MJH Channel {} Sample for Radio {}", sample.getChannel(), radioType); } int iBSS = busyTx + busySelf; @@ -1308,7 +1319,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra LOG.debug("wifiRadioStatusDbTableUpdate::Cannot get Equipment for AP {}", apId); return; } - + gatewayController.updateActiveCustomer(ce.getCustomerId()); ApElementConfiguration apElementConfiguration = ((ApElementConfiguration) ce.getDetails()); diff --git a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java index 10b2170..7d53430 100644 --- a/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java +++ b/opensync-gateway/src/main/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDao.java @@ -2336,15 +2336,11 @@ public class OvsdbDao { if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_rssi")) { // Map rowColumns = new HashMap<>(); - Set channelSet = new HashSet(); - channelSet.add(Long.valueOf(rc.channel)); - rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); rowColumns.put("radio_type", new Atom<>(rc.freqBand)); rowColumns.put("reporting_interval", new Atom<>(30)); - rowColumns.put("sampling_interval", new Atom<>(3)); +// rowColumns.put("sampling_interval", new Atom<>(3)); rowColumns.put("stats_type", new Atom<>("rssi")); rowColumns.put("survey_interval_ms", new Atom<>(65)); - rowColumns.put("report_type", new Atom<>("raw")); // rowColumns.put("survey_type", new Atom<>("on-chan")); Row updateRow = new Row(rowColumns); @@ -2447,11 +2443,8 @@ public class OvsdbDao { updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels2g); updateColumns.put("radio_type", new Atom<>("2.4G")); - updateColumns.put("reporting_interval", new Atom<>(600)); - updateColumns.put("report_type", new Atom<>("raw")); - updateColumns.put("sampling_interval", new Atom<>(60)); + updateColumns.put("reporting_interval", new Atom<>(120)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(65)); updateColumns.put("survey_type", new Atom<>("off-chan")); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); @@ -2463,11 +2456,8 @@ public class OvsdbDao { updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gl); updateColumns.put("radio_type", new Atom<>("5GL")); - updateColumns.put("reporting_interval", new Atom<>(600)); - updateColumns.put("report_type", new Atom<>("raw")); - updateColumns.put("sampling_interval", new Atom<>(45)); + updateColumns.put("reporting_interval", new Atom<>(120)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(65)); updateColumns.put("survey_type", new Atom<>("off-chan")); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); @@ -2479,11 +2469,8 @@ public class OvsdbDao { updateColumns = new HashMap<>(); updateColumns.put("channel_list", channels5gu); updateColumns.put("radio_type", new Atom<>("5GU")); - updateColumns.put("reporting_interval", new Atom<>(600)); - updateColumns.put("report_type", new Atom<>("raw")); - updateColumns.put("sampling_interval", new Atom<>(36)); + updateColumns.put("reporting_interval", new Atom<>(120)); updateColumns.put("stats_type", new Atom<>("neighbor")); - updateColumns.put("survey_interval_ms", new Atom<>(65)); updateColumns.put("survey_type", new Atom<>("off-chan")); row = new Row(updateColumns); operations.add(new Insert(wifiStatsConfigDbTable, row)); @@ -2494,15 +2481,9 @@ public class OvsdbDao { if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_neighbor_on-chan")) { // Map rowColumns = new HashMap<>(); - Set channelSet = new HashSet(); - channelSet.add(Long.valueOf(rc.channel)); - rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); rowColumns.put("radio_type", new Atom<>(rc.freqBand)); rowColumns.put("reporting_interval", new Atom<>(60)); - rowColumns.put("report_type", new Atom<>("raw")); - rowColumns.put("sampling_interval", new Atom<>(6)); rowColumns.put("stats_type", new Atom<>("neighbor")); - rowColumns.put("survey_interval_ms", new Atom<>(65)); rowColumns.put("survey_type", new Atom<>("on-chan")); Row updateRow = new Row(rowColumns); @@ -2548,9 +2529,6 @@ public class OvsdbDao { if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_survey_on-chan")) { Map rowColumns = new HashMap<>(); - Set channelSet = new HashSet(); - channelSet.add(Long.valueOf(rc.channel)); - rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); rowColumns.put("radio_type", new Atom<>(rc.freqBand)); rowColumns.put("reporting_interval", new Atom<>(60)); rowColumns.put("report_type", new Atom<>("raw")); @@ -2625,9 +2603,6 @@ public class OvsdbDao { if (!provisionedWifiStatsConfigs.containsKey(rc.freqBand + "_client")) { // Map rowColumns = new HashMap<>(); - Set channelSet = new HashSet(); - channelSet.add(Long.valueOf(rc.channel)); - rowColumns.put("channel_list", com.vmware.ovsdb.protocol.operation.notation.Set.of(channelSet)); rowColumns.put("radio_type", new Atom<>(rc.freqBand)); rowColumns.put("reporting_interval", new Atom<>(60)); rowColumns.put("report_type", new Atom<>("raw"));