From cc007f6115b4780f478d91aeff655aa85784b167 Mon Sep 17 00:00:00 2001 From: Lynn Shi Date: Thu, 1 Apr 2021 16:07:41 -0400 Subject: [PATCH] WIFI-1958 Sometime OnChannel is not reported on Channel Metric --- .../integration/utils/MqttStatsPublisher.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java index a369915..3dac927 100644 --- a/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java +++ b/opensync-ext-cloud/src/main/java/com/telecominfraproject/wlan/opensync/external/integration/utils/MqttStatsPublisher.java @@ -6,7 +6,6 @@ import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -81,8 +80,6 @@ import com.telecominfraproject.wlan.status.models.StatusDataType; import com.telecominfraproject.wlan.status.network.models.NetworkAdminStatusData; import com.telecominfraproject.wlan.systemevent.models.SystemEvent; -import javassist.bytecode.ByteArray; -import sts.OpensyncStats; import sts.OpensyncStats.AssocType; import sts.OpensyncStats.Client; import sts.OpensyncStats.ClientReport; @@ -1829,7 +1826,8 @@ public class MqttStatsPublisher { survey.getSurveyListList().stream().filter(t -> { if (survey.getSurveyType().equals(SurveyType.ON_CHANNEL)) { - return t.hasDurationMs() && (t.getDurationMs() > 0) && t.hasChannel() && t.hasBusy() && t.hasBusyTx() && t.hasNoise(); + return t.hasDurationMs() && (t.getDurationMs() > 0) && t.hasChannel() && + (t.hasBusy() || t.hasBusyTx() || t.hasBusySelf() || t.hasNoise()); } else { return t.hasDurationMs() && t.hasChannel(); } @@ -1855,10 +1853,12 @@ public class MqttStatsPublisher { channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap); } - channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap); - smr.setDetails(channelInfoReports); - smr.setCreatedTimestamp(survey.getTimestampMs()); - metricRecordList.add(smr); + if (!channelInfoMap.isEmpty()) { + channelInfoReports.setChannelInformationReportsPerRadio(channelInfoMap); + smr.setDetails(channelInfoReports); + smr.setCreatedTimestamp(survey.getTimestampMs()); + metricRecordList.add(smr); + } LOG.debug("ChannelInfoReports {}", channelInfoReports);