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