Search in sources :

Example 21 with PacketInfo

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

the class RrcStateRangeFactoryImplTest method create3G_test2.

@Test
public void create3G_test2() {
    // promotestate is TAIL_DCH
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(1000.0);
    when(profile3g.getDchFachTimer()).thenReturn(1000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(1000.0);
    double traceDuration = 2000.0;
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 1500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.TAIL_DCH);
    packetlist.add(pktInfoArray[0]);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 100.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[1]);
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile3g, traceDuration);
    assertEquals(1, testList.size());
}
Also used : ArrayList(java.util.ArrayList) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 22 with PacketInfo

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

the class RrcStateRangeFactoryImplTest method Create3G_test9.

@Test
public void Create3G_test9() {
    // promoState == RRCState.STATE_DCH
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(12000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(20000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(2500.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(6000.0);
    when(profile3g.getDchFachTimer()).thenReturn(5000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(10000.0);
    double traceDuration = 2000.0;
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 7500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[0]);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 10000.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[1]);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 15000.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[2]);
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile3g, traceDuration);
    assertEquals(1, testList.size());
}
Also used : ArrayList(java.util.ArrayList) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 23 with PacketInfo

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

the class ThroughputCalculatorImplTest method calculateThroughput_b.

// condition, head.getTimeStamp() > beginTS, tail.getTimeStamp() > maxTS , adjust input the variable
@Test
public void calculateThroughput_b() {
    Date date = new Date();
    List<Throughput> testResult = new ArrayList<Throughput>();
    List<PacketInfo> packets = new ArrayList<PacketInfo>();
    PacketInfo pktInfo01 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo01.getDir()).thenReturn(PacketDirection.UPLINK);
    Mockito.when(pktInfo01.getTimeStamp()).thenReturn(date.getTime() + 20000.0);
    packets.add(pktInfo01);
    PacketInfo pktInfo02 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo02.getDir()).thenReturn(PacketDirection.DOWNLINK);
    Mockito.when(pktInfo02.getTimeStamp()).thenReturn(date.getTime() + 20400.0);
    packets.add(pktInfo02);
    PacketInfo pktInfo03 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo03.getDir()).thenReturn(PacketDirection.DOWNLINK);
    Mockito.when(pktInfo03.getTimeStamp()).thenReturn(date.getTime() + 20500.0);
    packets.add(pktInfo03);
    PacketInfo pktInfo04 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo04.getDir()).thenReturn(PacketDirection.DOWNLINK);
    Mockito.when(pktInfo04.getTimeStamp()).thenReturn(date.getTime() + 41000.0);
    packets.add(pktInfo04);
    PacketInfo pktInfo05 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo05.getDir()).thenReturn(PacketDirection.DOWNLINK);
    Mockito.when(pktInfo05.getTimeStamp()).thenReturn(date.getTime() + 71000.0);
    packets.add(pktInfo05);
    PacketInfo pktInfo06 = Mockito.mock(PacketInfo.class);
    Mockito.when(pktInfo06.getDir()).thenReturn(PacketDirection.UPLINK);
    Mockito.when(pktInfo06.getTimeStamp()).thenReturn(date.getTime() + 72000.0);
    packets.add(pktInfo06);
    testResult = throughputCalculator.calculateThroughput(date.getTime() + 0.0, date.getTime() + 73000.0, 60000.0, packets);
    assertEquals(2, testResult.size());
}
Also used : ArrayList(java.util.ArrayList) Throughput(com.att.aro.core.packetanalysis.pojo.Throughput) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Date(java.util.Date) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 24 with PacketInfo

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

the class DiagnosticsTab method setTimeLineToTable.

// old analyzer method name is setTimeLineLinkedComponents(double
// timeStamp,double dTimeRangeInterval)
public void setTimeLineToTable(double timeStamp) {
    // logger.info("enter setTimeLineTable()");
    if (getAroTraceData() == null) {
        LOGGER.info("no analyze traces data");
    } else {
        boolean bTCPTimeStampFound = false;
        boolean bExactMatch = false;
        // Attempt to find corresponding packet for time.
        double packetTimeStamp = 0.0;
        double packetTimeStampDiff = 0.0;
        double previousPacketTimeStampDiff = 9999.0;
        Session bestMatchingTcpSession = null;
        PacketInfo bestMatchingPacketInfo = null;
        // logger.info("enter sesionlist for loop");
        for (Session tcpSess : getAroTraceData().getAnalyzerResult().getSessionlist()) {
            PacketInfo packetInfo = diagHelper.getBestMatchingPacketInTcpSession(tcpSess, bExactMatch, timeStamp, MATCH_SECONDS_RANGE);
            if (packetInfo != null) {
                packetTimeStamp = packetInfo.getTimeStamp();
                packetTimeStampDiff = timeStamp - packetTimeStamp;
                if (packetTimeStampDiff < 0.0) {
                    packetTimeStampDiff *= -1.0;
                }
                if (packetTimeStampDiff < previousPacketTimeStampDiff) {
                    bestMatchingTcpSession = tcpSess;
                    bestMatchingPacketInfo = packetInfo;
                    bTCPTimeStampFound = true;
                }
            }
        }
        // logger.info("leave sesionlist for loop");
        if (bTCPTimeStampFound) {
            getJTCPFlowsTable().selectItem(bestMatchingTcpSession);
            getJPacketViewTable().selectItem(bestMatchingPacketInfo);
            getJPacketViewTable().setGridColor(Color.LIGHT_GRAY);
        } else {
            getJTCPFlowsTable().selectItem(null);
            getJPacketViewTable().selectItem(null);
        // if (videoPlayer != null) {
        // bTCPPacketFound = false;
        // videoPlayer.setMediaDisplayTime(graphPanel
        // .getCrosshair());
        // }
        // }
        }
    }
// logger.info("leave setTimeLineTable()");
}
Also used : PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) HttpRequestResponseInfoWithSession(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfoWithSession) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 25 with PacketInfo

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

the class DiagnosticsTab method getJPacketViewTable.

/**
 * Initializes and returns the Packet View Table.
 */
public DataTable<PacketInfo> getJPacketViewTable() {
    if (jPacketViewTable == null) {
        jPacketViewTable = new DataTable<PacketInfo>(jPacketViewTableModel);
        jPacketViewTable.setName(ResourceBundleHelper.getMessageString("diagnostics.packet.view.tableName"));
        jPacketViewTable.setAutoCreateRowSorter(true);
        jPacketViewTable.setGridColor(Color.LIGHT_GRAY);
        jPacketViewTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

            PacketInfo packetInfo;

            @Override
            public void valueChanged(ListSelectionEvent arg0) {
                PacketInfo packetInfo = jPacketViewTable.getSelectedItem();
                if (packetInfo != null && packetInfo != this.packetInfo) {
                    double crossHairValue = packetInfo.getTimeStamp();
                    boolean centerGraph = !(crossHairValue <= graphPanel.getViewportUpperBound() && crossHairValue >= graphPanel.getViewportLowerBound());
                    // crossHairValue+103
                    graphPanel.setGraphView(crossHairValue, centerGraph);
                    // packetInfo.getRequestResponseInfo());
                    if (videoPlayer != null) {
                        // logger.info("enter getJPacketViewTable()");
                        videoPlayer.setMediaTime(graphPanel.getCrosshair());
                    // logger.info("leave getJPacketViewTable()");
                    }
                }
                this.packetInfo = packetInfo;
            }
        });
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) jPacketViewTable.getPopup();
        popupMenu.initialize();
    }
    return jPacketViewTable;
}
Also used : ListSelectionEvent(javax.swing.event.ListSelectionEvent) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) ListSelectionListener(javax.swing.event.ListSelectionListener)

Aggregations

PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)119 ArrayList (java.util.ArrayList)92 BaseTest (com.att.aro.core.BaseTest)63 Test (org.junit.Test)63 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)48 Session (com.att.aro.core.packetanalysis.pojo.Session)33 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)30 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)26 Profile (com.att.aro.core.configuration.pojo.Profile)25 InetAddress (java.net.InetAddress)25 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)21 ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)18 HashSet (java.util.HashSet)16 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)14 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)14 Packet (com.att.aro.core.packetreader.pojo.Packet)11 HashMap (java.util.HashMap)11 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)9 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)9 IPPacket (com.att.aro.core.packetreader.pojo.IPPacket)9