Search in sources :

Example 16 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HttpsUsageImplTest method testDomainNameNoSeparator.

@Test
public void testDomainNameNoSeparator() {
    String domainNameUnderTest = "bzsvdcwfxtqfy";
    pktAnalyzerResult = domainNameTestSetup("157.56.19.80", "216.58.194.196", "157.56.19.80", "www.gstatic.com", domainNameUnderTest);
    Statistic statistic = new Statistic();
    statistic.setTotalByte(123);
    statistic.setTotalHTTPSByte(123);
    statistic.setTotalHTTPSBytesNotAnalyzed(123);
    pktAnalyzerResult.setStatistic(statistic);
    httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult);
    httpsUsageEntries = httpsUsageResult.getResults();
    domainNameTestVerification(httpsUsageEntries, domainNameUnderTest);
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 17 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HttpsUsageImplTest method testParentDomainNameUsed_IPDomainNameMix.

@Test
public void testParentDomainNameUsed_IPDomainNameMix() {
    pktAnalyzerResult = domainNameTestSetup("157.56.19.80", "216.58.194.196", "157.56.19.80", "www.gstatic.com", "www.arotest.com");
    Statistic statistic = new Statistic();
    statistic.setTotalByte(123);
    statistic.setTotalHTTPSByte(123);
    statistic.setTotalHTTPSBytesNotAnalyzed(123);
    pktAnalyzerResult.setStatistic(statistic);
    httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult);
    httpsUsageEntries = httpsUsageResult.getResults();
    domainNameTestVerification(httpsUsageEntries);
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 18 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HttpsUsageImplTest method testParentDomainNameUsed_MultiLevelDomainNames.

@Test
public void testParentDomainNameUsed_MultiLevelDomainNames() {
    pktAnalyzerResult = domainNameTestSetup("157.56.19.80", "216.58.194.196", "bogusa.bogusb.gstatic.com", "bogusa.gstatic.com", "www.arotest.com");
    Statistic statistic = new Statistic();
    statistic.setTotalByte(123);
    statistic.setTotalHTTPSByte(123);
    statistic.setTotalHTTPSBytesNotAnalyzed(123);
    pktAnalyzerResult.setStatistic(statistic);
    httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult);
    httpsUsageEntries = httpsUsageResult.getResults();
    domainNameTestVerification(httpsUsageEntries);
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 19 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class TCPSessionStatisticsPanel method refresh.

@Override
public void refresh(AROTraceData model) {
    Statistic statistic = model.getAnalyzerResult().getStatistic();
    if (statistic != null) {
        String intFormatString = "%,2d";
        String doubleFormatString = "%,1.1f";
        String timeUnit = " s";
        tabPanelCommon.setText(LabelKeys.tcpstatistics_size, String.format(intFormatString, statistic.getTotalTCPBytes()));
        tabPanelCommon.setText(LabelKeys.tcpstatistics_duration, String.format(doubleFormatString, statistic.getTcpPacketDuration()));
        tabPanelCommon.setText(LabelKeys.tcpstatistics_packets, String.format(intFormatString, statistic.getTotalTCPPackets()));
        tabPanelCommon.setText(LabelKeys.tcpstatistics_throughput, String.format(doubleFormatString, statistic.getAverageTCPKbps()));
        tabPanelCommon.setText(LabelKeys.tcpstatistics_minLatency, Util.formatDoubleToMicro(statistic.getMinLatency()) + timeUnit);
        tabPanelCommon.setText(LabelKeys.tcpstatistics_maxLatency, Util.formatDoubleToMicro(statistic.getMaxLatency()) + timeUnit);
        tabPanelCommon.setText(LabelKeys.tcpstatistics_averageLatency, Util.formatDoubleToMicro(statistic.getAverageLatency()) + timeUnit);
    }
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic)

Example 20 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class GraphPanel method filterFlowTable.

// In 4.1.1, the method called refreshGraph()
public void filterFlowTable() {
    AROTraceData filteredSessionTraceData = getTraceData();
    double filteredStartTime = 0.0;
    double filteredEndTime = 0.0;
    double filteredDuration = filteredSessionTraceData.getAnalyzerResult().getTraceresult().getTraceDuration();
    List<Session> tcpsessionsList = new ArrayList<Session>();
    if (getTraceData() == null) {
        return;
    } else {
        TCPUDPFlowsTableModel model = (TCPUDPFlowsTableModel) parent.getJTCPFlowsTable().getModel();
        Map<String, Session> subSessionMap = model.getSessionMap();
        Map<String, Boolean> subcheckboxMap = model.getCheckboxMap();
        for (Map.Entry<String, Boolean> entry : subcheckboxMap.entrySet()) {
            if (entry.getValue()) {
                tcpsessionsList.add(subSessionMap.get(entry.getKey()));
            }
        }
        filteredSessionTraceData.getAnalyzerResult().setSessionlist(tcpsessionsList);
    }
    List<PacketInfo> packetsForSelectedSession = new ArrayList<PacketInfo>();
    for (Session tcpSession : tcpsessionsList) {
        if (tcpSession.getTcpPackets() != null) {
            packetsForSelectedSession.addAll(tcpSession.getTcpPackets());
        }
    }
    // when generating graph, make sure session is ordered by time stamp
    Collections.sort(packetsForSelectedSession, new Comparator<PacketInfo>() {

        @Override
        public int compare(PacketInfo p1, PacketInfo p2) {
            return (int) (p1.getTimeStamp() * 1000 - p2.getTimeStamp() * 1000);
        }
    });
    boolean selectedAllPackets = false;
    // Adding the TCP packets to the trace for getting redoing the analysis
    if (packetsForSelectedSession.size() > 0) {
        if (tcpsessionsList.size() == getAllTcpSessions()) {
            // For select all use all exiting packets
            filteredSessionTraceData.getAnalyzerResult().getTraceresult().setAllpackets(getAllPackets());
            selectedAllPackets = true;
        } else {
            // Collections.sort(packetsForSelectedSession);//?
            filteredSessionTraceData.getAnalyzerResult().getTraceresult().setAllpackets(packetsForSelectedSession);
        }
    }
    if (selectedAllPackets) {
        filteredStartTime = -0.01;
        filteredEndTime = filteredDuration;
    } else {
        int index = 0;
        for (Session tcpSession : tcpsessionsList) {
            if (tcpSession.getTcpPackets().size() != 0) {
                if (index == 0) {
                    filteredStartTime = tcpSession.getTcpPackets().get(0).getTimeStamp();
                    filteredEndTime = tcpSession.getTcpPackets().get(0).getTimeStamp();
                }
                if (filteredStartTime > tcpSession.getTcpPackets().get(0).getTimeStamp()) {
                    filteredStartTime = tcpSession.getTcpPackets().get(0).getTimeStamp();
                }
                if (filteredEndTime < tcpSession.getTcpPackets().get(0).getTimeStamp()) {
                    filteredEndTime = tcpSession.getTcpPackets().get(0).getTimeStamp();
                }
                index++;
            }
        }
        if (index == 0) {
            filteredStartTime = 0.0;
            filteredEndTime = 0.0;
        }
    }
    // for Analysis data particular time of the graph, some number is not clear..
    if (filteredStartTime > 0) {
        // adjust the time line axis number
        filteredStartTime = filteredStartTime - 2;
        if (filteredStartTime < 0) {
            filteredStartTime = -0.01;
        }
    }
    if (filteredStartTime < 0) {
        filteredStartTime = -0.01;
    }
    if (!selectedAllPackets) {
        if (filteredEndTime > 0) {
            // adjust the time line axis number
            filteredEndTime = filteredEndTime + 15;
        }
        if (filteredEndTime > filteredDuration) {
            filteredEndTime = filteredDuration;
        }
    }
    this.startTime = filteredStartTime;
    this.endTime = filteredEndTime;
    if (getTraceData() != null) {
        TimeRange timeRange = new TimeRange(filteredStartTime, filteredEndTime);
        AnalysisFilter filter = filteredSessionTraceData.getAnalyzerResult().getFilter();
        filter.setTimeRange(timeRange);
        filteredSessionTraceData.getAnalyzerResult().setFilter(filter);
        Statistic stat = ContextAware.getAROConfigContext().getBean(IPacketAnalyzer.class).getStatistic(packetsForSelectedSession);
        long totaltemp = 0;
        for (Session byteCountSession : tcpsessionsList) {
            totaltemp += byteCountSession.getBytesTransferred();
        }
        stat.setTotalByte(totaltemp);
        AbstractRrcStateMachine statemachine = ContextAware.getAROConfigContext().getBean(IRrcStateMachineFactory.class).create(packetsForSelectedSession, filteredSessionTraceData.getAnalyzerResult().getProfile(), stat.getPacketDuration(), filteredDuration, stat.getTotalByte(), timeRange);
        BurstCollectionAnalysisData burstcollectiondata = new BurstCollectionAnalysisData();
        if (stat.getTotalByte() > 0) {
            burstcollectiondata = ContextAware.getAROConfigContext().getBean(IBurstCollectionAnalysis.class).analyze(packetsForSelectedSession, filteredSessionTraceData.getAnalyzerResult().getProfile(), stat.getPacketSizeToCountMap(), statemachine.getStaterangelist(), filteredSessionTraceData.getAnalyzerResult().getTraceresult().getUserEvents(), filteredSessionTraceData.getAnalyzerResult().getTraceresult().getCpuActivityList().getCpuActivities(), tcpsessionsList);
        }
        filteredSessionTraceData.getAnalyzerResult().getStatistic().setTotalByte(stat.getTotalByte());
        filteredSessionTraceData.getAnalyzerResult().setStatemachine(statemachine);
        filteredSessionTraceData.getAnalyzerResult().setBurstCollectionAnalysisData(burstcollectiondata);
        refresh(filteredSessionTraceData);
    }
}
Also used : TCPUDPFlowsTableModel(com.att.aro.ui.model.diagnostic.TCPUDPFlowsTableModel) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ArrayList(java.util.ArrayList) Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) AbstractRrcStateMachine(com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine) IPacketAnalyzer(com.att.aro.core.packetanalysis.IPacketAnalyzer) AROTraceData(com.att.aro.core.pojo.AROTraceData) Point(java.awt.Point) TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) BurstCollectionAnalysisData(com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData) Map(java.util.Map) EnumMap(java.util.EnumMap) TreeMap(java.util.TreeMap) IRrcStateMachineFactory(com.att.aro.core.packetanalysis.IRrcStateMachineFactory) Session(com.att.aro.core.packetanalysis.pojo.Session)

Aggregations

Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)22 BaseTest (com.att.aro.core.BaseTest)11 ArrayList (java.util.ArrayList)11 Test (org.junit.Test)11 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)9 Session (com.att.aro.core.packetanalysis.pojo.Session)9 InetAddress (java.net.InetAddress)8 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)4 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)3 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)3 EnergyModel (com.att.aro.core.packetanalysis.pojo.EnergyModel)3 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)2 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)2 TimeRangeAnalysis (com.att.aro.core.packetanalysis.impl.TimeRangeAnalysis)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)2 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)2 AROTraceData (com.att.aro.core.pojo.AROTraceData)2 File (java.io.File)2