From 76d9cf79f5de951ab6bca0cc27653e86a40b1a7f Mon Sep 17 00:00:00 2001 From: Mike Hansen Date: Fri, 9 Oct 2020 13:34:17 -0400 Subject: [PATCH] WIFI-444: APNOS : UCC Heuristics phase 2 New VideoVoice protobufs ** also fix Json file for captive portal static tests. --- ...ternalIntegrationMqttMessageProcessor.java | 28 +++++++++---------- .../OpensyncExternalIntegrationSimple.java | 3 ++ .../src/main/resources/ProfileCaptive.json | 4 ++- .../app/opensync/ProfileCaptive.json | 4 ++- .../docker/app/opensync/ProfileCaptive.json | 4 ++- .../app/opensync/ProfileCaptive.json | 4 ++- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationMqttMessageProcessor.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationMqttMessageProcessor.java index 5de05c9..105ccc3 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationMqttMessageProcessor.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationMqttMessageProcessor.java @@ -29,7 +29,6 @@ import com.telecominfraproject.wlan.client.session.models.ClientSession; import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails; import com.telecominfraproject.wlan.client.session.models.ClientSessionMetricDetails; import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface; -import com.telecominfraproject.wlan.core.model.entity.MinMaxAvgValueInt; import com.telecominfraproject.wlan.core.model.equipment.ChannelBandwidth; import com.telecominfraproject.wlan.core.model.equipment.DetectedAuthMode; import com.telecominfraproject.wlan.core.model.equipment.MacAddress; @@ -47,7 +46,6 @@ import com.telecominfraproject.wlan.profile.ProfileServiceInterface; import com.telecominfraproject.wlan.profile.models.Profile; import com.telecominfraproject.wlan.profile.models.ProfileContainer; import com.telecominfraproject.wlan.profile.models.ProfileType; -import com.telecominfraproject.wlan.profile.rf.models.RfConfiguration; import com.telecominfraproject.wlan.profile.ssid.models.RadioBasedSsidConfiguration; import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration; import com.telecominfraproject.wlan.profile.ssid.models.SsidConfiguration.SecureMode; @@ -1515,7 +1513,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { Map avgNoiseFloor = new HashMap<>(); new HashMap<>(); Map capacityDetails = new HashMap<>(); - Map radioUtilizationDetailsMap = new HashMap<>(); + Map radioUtilizationDetailsMap = new HashMap<>(); // populate it from report.survey for (Survey survey : report.getSurveyList()) { @@ -1546,7 +1544,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { } - + if (totalDurationMs > 0) { RadioUtilization radioUtil = new RadioUtilization(); radioUtil.setTimestampSeconds((int) ((survey.getTimestampMs()) / 1000)); @@ -1554,7 +1552,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { radioUtil.setAssocClientTx(pctBusyTx); int pctBusyRx = busyRx / totalDurationMs; radioUtil.setAssocClientRx(pctBusyRx); - double pctIBSS = (double) ((busyTx + busySelf) / totalDurationMs); + double pctIBSS = (busyTx + busySelf) / totalDurationMs; radioUtil.setIbss(pctIBSS); int nonWifi = (busy - (busyTx + busyRx)) / totalDurationMs; radioUtil.setNonWifi(nonWifi); @@ -1569,9 +1567,9 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { int noiseAvg = (int) Math.round(DecibelUtils.getAverageDecibel(toIntArray(noiseList))); avgNoiseFloor.put(radioType, noiseAvg); apNodeMetrics.setNoiseFloor(radioType, noiseAvg); - + Long totalUtilization = Math.round((double) busy / totalDurationMs); - Long totalNonWifi = totalUtilization - (busyTx + busyRx) / totalDurationMs; + Long totalNonWifi = totalUtilization - ((busyTx + busyRx) / totalDurationMs); EquipmentCapacityDetails cap = new EquipmentCapacityDetails(); cap.setUnavailableCapacity(totalNonWifi.intValue()); @@ -1580,13 +1578,14 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { cap.setUsedCapacity(totalUtilization.intValue()); cap.setUnusedCapacity(availableCapacity - totalUtilization.intValue()); cap.setTotalCapacity(100); - + apNodeMetrics.setChannelUtilization(radioType, totalUtilization.intValue()); capacityDetails.put(radioType, cap); -// EquipmentPerRadioUtilizationDetails details = new EquipmentPerRadioUtilizationDetails(); -// details.setWifiFromOtherBss(new MinMaxAvgValueInt()); + // EquipmentPerRadioUtilizationDetails details = new + // EquipmentPerRadioUtilizationDetails(); + // details.setWifiFromOtherBss(new MinMaxAvgValueInt()); radioUtilizationDetailsMap.put(radioType, new EquipmentPerRadioUtilizationDetails()); - + } } @@ -2254,11 +2253,10 @@ public class OpensyncExternalIntegrationMqttMessageProcessor { long equipmentId, long locationId, long profileId) { LOG.debug("populateChannelInfoReports for Customer {} Equipment {}", customerId, equipmentId); - + ProfileContainer profileContainer = new ProfileContainer( - profileServiceInterface.getProfileWithChildren(profileId)); - RfConfiguration rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(profileId, ProfileType.rf) - .getDetails(); + profileServiceInterface.getProfileWithChildren(profileId)); + profileContainer.getChildOfTypeOrNull(profileId, ProfileType.rf).getDetails(); for (Survey survey : report.getSurveyList()) { diff --git a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java index 639e214..4e56ddc 100644 --- a/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java +++ b/opensync-ext-static/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/OpensyncExternalIntegrationSimple.java @@ -192,6 +192,9 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr public void processMqttMessage(String topic, Report report) { LOG.info("Received OpensyncStatsReport on topic {} for ap {}\n{}", topic, report.getNodeID(), report); + report.getVideoVoiceReportList().stream().forEach(v -> { + LOG.info("VideoVoiceReport {}", v); + }); report.getEventReportList().stream().forEach(e -> { LOG.info("Received EventReport {}", e); }); diff --git a/opensync-ext-static/src/main/resources/ProfileCaptive.json b/opensync-ext-static/src/main/resources/ProfileCaptive.json index e7766c9..9c9b52f 100644 --- a/opensync-ext-static/src/main/resources/ProfileCaptive.json +++ b/opensync-ext-static/src/main/resources/ProfileCaptive.json @@ -1,3 +1,4 @@ +[ { "model_type": "Profile", "id": 14, @@ -130,4 +131,5 @@ "createdTimestamp": 1602183994959, "lastModifiedTimestamp": 1602183994959, "childProfileIds": [] -} \ No newline at end of file +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileCaptive.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileCaptive.json index e7766c9..9c9b52f 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileCaptive.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileCaptive.json @@ -1,3 +1,4 @@ +[ { "model_type": "Profile", "id": 14, @@ -130,4 +131,5 @@ "createdTimestamp": 1602183994959, "lastModifiedTimestamp": 1602183994959, "childProfileIds": [] -} \ No newline at end of file +} +] \ No newline at end of file diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileCaptive.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileCaptive.json index e7766c9..9c9b52f 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileCaptive.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileCaptive.json @@ -1,3 +1,4 @@ +[ { "model_type": "Profile", "id": 14, @@ -130,4 +131,5 @@ "createdTimestamp": 1602183994959, "lastModifiedTimestamp": 1602183994959, "childProfileIds": [] -} \ No newline at end of file +} +] \ No newline at end of file diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileCaptive.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileCaptive.json index e7766c9..9c9b52f 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileCaptive.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileCaptive.json @@ -1,3 +1,4 @@ +[ { "model_type": "Profile", "id": 14, @@ -130,4 +131,5 @@ "createdTimestamp": 1602183994959, "lastModifiedTimestamp": 1602183994959, "childProfileIds": [] -} \ No newline at end of file +} +] \ No newline at end of file