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());
}
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());
}
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());
}
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()");
}
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;
}
Aggregations