use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class OverviewTabTableSplitPane method mousePressed.
@Override
public void mousePressed(MouseEvent event) {
if (event.getClickCount() == 2) {
if (event.getSource() instanceof JTable) {
int selectionIndex = ((JTable) event.getSource()).getSelectedRow();
LOGGER.info("selectionIndex: " + selectionIndex);
if (selectionIndex != -1) {
Session session = expandedDomainModel.getValueAt(selectionIndex);
overviewTab.updateDiagnosticsTab(session);
}
}
}
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class HTTPCacheStatistics method refresh.
@Override
public void refresh(AROTraceData model) {
PacketAnalyzerResult analyzerResult = model.getAnalyzerResult();
CacheAnalysis cacheAnalysis = analyzerResult.getCacheAnalysis();
Statistic statistic = analyzerResult.getStatistic();
List<Session> sessions = analyzerResult.getSessionlist();
if (cacheAnalysis != null && statistic != null && sessions != null) {
CacheAnalysisDerived cacheAnalysisDerived = new CacheAnalysisDerived(cacheAnalysis, statistic, sessions);
refreshLine(LabelKeys.cache_cacheable, cacheAnalysisDerived.getPctCacheableResponses(), cacheAnalysisDerived.getPctCacheableBytes());
refreshLine(LabelKeys.cache_nonCachable, cacheAnalysisDerived.getPctNonCacheableResponses(), cacheAnalysisDerived.getPctNonCacheableBytes());
refreshLine(LabelKeys.cache_cacheMiss, cacheAnalysisDerived.getPctCacheMissResponses(), cacheAnalysisDerived.getPctCacheMissBytes());
refreshLine(LabelKeys.cache_notCacheable, cacheAnalysisDerived.getPctNotCacheableResponses(), cacheAnalysisDerived.getPctNotCacheableBytes());
refreshLine(LabelKeys.cache_cacheHitExpiredDup304, cacheAnalysisDerived.getPctExpiredResponses(), cacheAnalysisDerived.getPctExpiredBytes());
refreshLine(LabelKeys.cache_cacheHitRespChanged, cacheAnalysisDerived.getPctNotExpiredResponses(), cacheAnalysisDerived.getPctNotExpiredBytes());
refreshLine(LabelKeys.cache_cacheHitNotExpiredDup, cacheAnalysisDerived.getPctCacheMissResponses(), cacheAnalysisDerived.getPctCacheMissBytes());
refreshLine(LabelKeys.cache_cacheHitExpiredClientDup, cacheAnalysisDerived.getPctNotCacheableResponses(), cacheAnalysisDerived.getPctNotCacheableBytes());
refreshLine(LabelKeys.cache_cacheHitExpiredServerDup, cacheAnalysisDerived.getPctCacheHitNotExpiredDupResponses(), cacheAnalysisDerived.getPctCacheHitNotExpiredDupBytes());
refreshLine(LabelKeys.cache_partialHitNotExpiredDup, cacheAnalysisDerived.getPctCacheHitRespChangedResponses(), cacheAnalysisDerived.getPctCacheHitRespChangedBytes());
refreshLine(LabelKeys.cache_partialHitExpiredClientDup, cacheAnalysisDerived.getPctCacheHitExpiredDupClientResponses(), cacheAnalysisDerived.getPctCacheHitExpiredDupClientBytes());
refreshLine(LabelKeys.cache_partialHitExpiredServerDup, cacheAnalysisDerived.getPctCacheHitExpiredDupServerResponses(), cacheAnalysisDerived.getPctCacheHitExpiredDupServerBytes());
refreshLine(LabelKeys.cache_notExpired, cacheAnalysisDerived.getPctCacheHitDup304Responses(), cacheAnalysisDerived.getPctCacheHitDup304Bytes());
refreshLine(LabelKeys.cache_notExpiredHeur, cacheAnalysisDerived.getPctPartialHitExpiredDupClientResponses(), cacheAnalysisDerived.getPctPartialHitExpiredDupClientBytes());
refreshLine(LabelKeys.cache_expired, cacheAnalysisDerived.getPctPartialHitExpiredDupServerResponses(), cacheAnalysisDerived.getPctPartialHitExpiredDupServerBytes());
refreshLine(LabelKeys.cache_expiredHeur, cacheAnalysisDerived.getPctPartialHitNotExpiredDupResponses(), cacheAnalysisDerived.getPctPartialHitNotExpiredDupBytes());
}
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class WaterfallPanel method refresh.
/**
* Refreshes the waterfall display with the specified analysis data
* @param Analyzed data from aro core.
*/
public void refresh(AROTraceData aModel) {
this.data = aModel;
this.popup.refresh(null, 0);
this.popup.setVisible(false);
// Create sorted list of request/response pairs
categoryList = new ArrayList<WaterfallCategory>();
if (aModel != null && aModel.getAnalyzerResult() != null) {
this.traceDuration = aModel.getAnalyzerResult().getTraceresult().getTraceDuration();
// add 20% to make sure labels close to the right edge of the screen are visible
this.traceDuration *= 1.2;
for (Session tcpSession : aModel.getAnalyzerResult().getSessionlist()) {
Session thisSession = tcpSession;
if (!tcpSession.isUdpOnly()) {
for (HttpRequestResponseInfo reqResInfo : tcpSession.getRequestResponseInfo()) {
if (reqResInfo.getDirection() == HttpDirection.REQUEST && reqResInfo.getWaterfallInfos() != null) {
categoryList.add(new WaterfallCategory(reqResInfo, thisSession));
}
}
}
}
// Sort and set index
Collections.sort(categoryList);
int index = 0;
for (WaterfallCategory wCategory : categoryList) {
wCategory.setIndex(++index);
}
}
// Horizontal scroll bar used to scroll through trace duration
JScrollBar hScrollBar = getHorizontalScroll();
hScrollBar.setMaximum((int) Math.ceil(this.traceDuration));
CategoryAxis cAxis = getCategoryAxis();
cAxis.clearCategoryLabelToolTips();
DefaultCategoryDataset underlying = new DefaultCategoryDataset();
for (WaterfallCategory wfc : categoryList) {
RequestResponseTimeline rrTimeLine = wfc.getReqResp().getWaterfallInfos();
underlying.addValue(rrTimeLine.getStartTime(), Waterfall.BEFORE, wfc);
underlying.addValue(rrTimeLine.getDnsLookupDuration(), Waterfall.DNS_LOOKUP, wfc);
underlying.addValue(rrTimeLine.getInitialConnDuration(), Waterfall.INITIAL_CONNECTION, wfc);
underlying.addValue(rrTimeLine.getSslNegotiationDuration(), Waterfall.SSL_NEGOTIATION, wfc);
underlying.addValue(rrTimeLine.getRequestDuration(), Waterfall.REQUEST_TIME, wfc);
underlying.addValue(rrTimeLine.getTimeToFirstByte(), Waterfall.TIME_TO_FIRST_BYTE, wfc);
underlying.addValue(rrTimeLine.getContentDownloadDuration(), Waterfall.CONTENT_DOWNLOAD, wfc);
underlying.addValue(null, Waterfall.HTTP_3XX_REDIRECTION, wfc);
underlying.addValue(null, Waterfall.HTTP_4XX_CLIENTERROR, wfc);
int code = wfc.getReqResp().getAssocReqResp().getStatusCode();
double endTime = this.traceDuration - rrTimeLine.getStartTime() - rrTimeLine.getTotalTime();
if (code >= 300 && code < 400) {
underlying.addValue(endTime, Waterfall.AFTER_3XX, wfc);
} else if (code >= 400) {
underlying.addValue(endTime, Waterfall.AFTER_4XX, wfc);
} else {
underlying.addValue(endTime, Waterfall.AFTER, wfc);
}
cAxis.addCategoryLabelToolTip(wfc, wfc.getTooltip());
}
// Vertical scroll bar is used to scroll through data
JScrollBar vScrollBar = getVerticalScroll();
int count = underlying.getColumnCount();
vScrollBar.setValue(0);
vScrollBar.setMaximum(count);
vScrollBar.setVisibleAmount(count > 0 ? this.dataset.getMaximumCategoryCount() - 1 / count : 1);
// Add the dataset to the plot
CategoryPlot plot = getChartPanel().getChart().getCategoryPlot();
this.dataset = new SlidingCategoryDataset(underlying, 0, CATEGORY_MAX_COUNT);
plot.setDataset(this.dataset);
// Set the visible time range
setTimeRange(startGraphRange, startGraphRange + 100);
// Place proper colors on renderer for waterfall states
final CategoryItemRenderer renderer = plot.getRenderer();
for (Object obj : underlying.getRowKeys()) {
Waterfall wFall = (Waterfall) obj;
int index = underlying.getRowIndex(wFall);
Color paint;
switch(wFall) {
case DNS_LOOKUP:
paint = dnsLoolupColor;
break;
case INITIAL_CONNECTION:
paint = initiaConnColor;
break;
case SSL_NEGOTIATION:
paint = sslNegColor;
break;
case REQUEST_TIME:
paint = requestTimeColor;
break;
case TIME_TO_FIRST_BYTE:
paint = firstByteTimeColor;
break;
case CONTENT_DOWNLOAD:
paint = contentDownloadColor;
break;
case INACTIVE:
paint = inactiveConnectionColor;
break;
case AFTER_3XX:
paint = noneColor;
renderer.setSeriesItemLabelPaint(index, threexColor);
renderer.setSeriesVisibleInLegend(index, false);
break;
case AFTER_4XX:
paint = noneColor;
renderer.setSeriesItemLabelPaint(index, fourxColor);
renderer.setSeriesVisibleInLegend(index, false);
break;
case HTTP_3XX_REDIRECTION:
paint = threexColor;
break;
case HTTP_4XX_CLIENTERROR:
paint = fourxColor;
break;
default:
renderer.setSeriesItemLabelPaint(index, Color.black);
renderer.setSeriesVisibleInLegend(index, false);
paint = noneColor;
}
renderer.setSeriesPaint(index, paint);
}
// Adding the label at the end of bars
renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator() {
private static final long serialVersionUID = 1L;
@Override
public String generateLabel(CategoryDataset dataset, int row, int column) {
if (Waterfall.AFTER == dataset.getRowKey(row) || Waterfall.AFTER_3XX == dataset.getRowKey(row) || Waterfall.AFTER_4XX == dataset.getRowKey(row)) {
WaterfallCategory waterfallItem = (WaterfallCategory) dataset.getColumnKey(column);
RequestResponseTimeline waterfallInfos = waterfallItem.getReqResp().getWaterfallInfos();
DecimalFormat formatter = new DecimalFormat("#.##");
int code = waterfallItem.getReqResp().getAssocReqResp().getStatusCode();
return MessageFormat.format(getMessageString("waterfall.totalTime"), formatter.format(waterfallInfos.getTotalTime()), code > 0 ? waterfallItem.getReqResp().getScheme() + " " + code : getMessageString("waterfall.unknownCode"));
}
return null;
}
});
new Thread(() -> setCrosshairs(aModel)).start();
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class ARODiagnosticsOverviewRouteImpl method updateDiagnosticsTab.
@Override
public void updateDiagnosticsTab(Object routeInfo) {
int oldPanelIndex = jtabbedPane.getSelectedIndex();
jtabbedPane.setSelectedIndex(DIAGNOSTIC_INDEX);
DiagnosticsTab diagnosticsTab = (DiagnosticsTab) jtabbedPane.getSelectedComponent();
if (routeInfo == null) {
jtabbedPane.setSelectedIndex(oldPanelIndex);
LOG.error("Diagnostics Tab needs a type for updating");
return;
}
LOG.debug("Type used to route to Diagnostics Tab: " + routeInfo.getClass().getSimpleName());
if (routeInfo instanceof CacheEntry) {
diagnosticsTab.setHighlightedTCP(((CacheEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof Session) {
diagnosticsTab.setHighlightedTCP(((Session) routeInfo));
} else if (routeInfo instanceof HttpRequestResponseInfo) {
diagnosticsTab.setHighlightedTCP((HttpRequestResponseInfo) routeInfo);
} else if (routeInfo instanceof HttpEntry) {
diagnosticsTab.setHighlightedTCP(((HttpEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof DisplayNoneInCSSEntry) {
diagnosticsTab.setHighlightedTCP(((DisplayNoneInCSSEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof ImageMdataEntry) {
diagnosticsTab.setHighlightedTCP(((ImageMdataEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof ImageCompressionEntry) {
diagnosticsTab.setHighlightedTCP(((ImageCompressionEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof MultipleConnectionsEntry) {
if (((MultipleConnectionsEntry) routeInfo).isMultiple()) {
jtabbedPane.setSelectedIndex(WATERFALL_INDEX);
WaterfallTab waterfallTab = (WaterfallTab) jtabbedPane.getSelectedComponent();
waterfallTab.updateGraph(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
} else {
if (((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo().getSession() != null) {
diagnosticsTab.setHighlightedSessionTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
} else {
diagnosticsTab.setHighlightedTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
}
}
} else if (routeInfo instanceof SpriteImageEntry) {
diagnosticsTab.setHighlightedTCP(((SpriteImageEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof UnnecessaryConnectionEntry) {
UnnecessaryConnectionEntry unConnectionEntry = (UnnecessaryConnectionEntry) routeInfo;
diagnosticsTab.setHighlightedTCP(unConnectionEntry.getLowTime());
} else if (routeInfo instanceof TransmissionPrivateDataEntry || routeInfo instanceof UnsecureSSLVersionEntry || routeInfo instanceof ForwardSecrecyEntry) {
diagnosticsTab.setHighlightedTCP(routeInfo);
} else if (routeInfo instanceof VideoStall) {
double timestamp = ((VideoStall) routeInfo).getSegmentTryingToPlay().getStartTS();
diagnosticsTab.getGraphPanel().setGraphView(timestamp, true);
diagnosticsTab.getVideoPlayer().setMediaTime(timestamp);
} else {
jtabbedPane.setSelectedIndex(oldPanelIndex);
LOG.error("Diagnostics Tab cannot handle a type of " + routeInfo.getClass().getSimpleName() + " for updating");
}
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class SpriteImageImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
SpriteImageResult result = new SpriteImageResult();
List<SpriteImageEntry> analysisResults = new ArrayList<SpriteImageEntry>();
for (Session session : tracedata.getSessionlist()) {
double lastTimeStamp = 0.0;
HttpRequestResponseInfo lastReqRessInfo = null;
HttpRequestResponseInfo secondReqRessInfo = null;
boolean thirdOccurrenceTriggered = false;
for (HttpRequestResponseInfo req : session.getRequestResponseInfo()) {
if (req.getDirection() == HttpDirection.RESPONSE && req.getContentType() != null && req.getFirstDataPacket() != null && req.getContentType().contains("image/") && req.getContentLength() < IMAGE_SIZE_LIMIT) {
PacketInfo pktInfo = req.getFirstDataPacket();
if (lastTimeStamp == 0.0) {
lastTimeStamp = pktInfo.getTimeStamp();
lastReqRessInfo = req;
continue;
} else {
if ((pktInfo.getTimeStamp() - lastTimeStamp) <= 5.0) {
if (!thirdOccurrenceTriggered) {
secondReqRessInfo = req;
thirdOccurrenceTriggered = true;
continue;
} else {
/* -At this stage 3 images found to be downloaded in 5 secs. store them.
* -fix for defect DE26829*/
analysisResults.add(new SpriteImageEntry(lastReqRessInfo));
analysisResults.add(new SpriteImageEntry(secondReqRessInfo));
analysisResults.add(new SpriteImageEntry(req));
/* -reset the variables to search more such images in this session
* -fix for defect DE26829 */
lastTimeStamp = 0.0;
lastReqRessInfo = null;
secondReqRessInfo = null;
thirdOccurrenceTriggered = false;
}
}
lastTimeStamp = pktInfo.getTimeStamp();
lastReqRessInfo = req;
secondReqRessInfo = null;
thirdOccurrenceTriggered = false;
}
}
}
}
result.setAnalysisResults(analysisResults);
String text = "";
if (analysisResults.isEmpty()) {
result.setResultType(BPResultType.PASS);
text = MessageFormat.format(textResultPass, analysisResults.size());
result.setResultText(text);
result.setResultExcelText(BPResultType.PASS.getDescription());
} else {
result.setResultType(BPResultType.FAIL);
text = MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), analysisResults.size());
result.setResultText(text);
result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), analysisResults.size()));
}
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAllNumberOfSpriteFiles(exportAllNumberOfSpriteFiles);
return result;
}
Aggregations