Search in sources :

Example 76 with Session

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);
            }
        }
    }
}
Also used : JTable(javax.swing.JTable) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 77 with 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());
    }
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) CacheAnalysis(com.att.aro.core.packetanalysis.pojo.CacheAnalysis) CacheAnalysisDerived(com.att.aro.ui.view.statistics.model.CacheAnalysisDerived) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 78 with Session

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();
}
Also used : StandardCategoryItemLabelGenerator(org.jfree.chart.labels.StandardCategoryItemLabelGenerator) RequestResponseTimeline(com.att.aro.core.packetanalysis.pojo.RequestResponseTimeline) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) Color(java.awt.Color) DecimalFormat(java.text.DecimalFormat) ResourceBundleHelper.getMessageString(com.att.aro.ui.utils.ResourceBundleHelper.getMessageString) CategoryPlot(org.jfree.chart.plot.CategoryPlot) SlidingCategoryDataset(org.jfree.data.category.SlidingCategoryDataset) JScrollBar(javax.swing.JScrollBar) CategoryAxis(org.jfree.chart.axis.CategoryAxis) SlidingCategoryDataset(org.jfree.data.category.SlidingCategoryDataset) DefaultCategoryDataset(org.jfree.data.category.DefaultCategoryDataset) CategoryDataset(org.jfree.data.category.CategoryDataset) WaterfallCategory(com.att.aro.ui.model.waterfall.WaterfallCategory) DefaultCategoryDataset(org.jfree.data.category.DefaultCategoryDataset) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 79 with Session

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");
    }
}
Also used : ImageMdataEntry(com.att.aro.core.bestpractice.pojo.ImageMdataEntry) TransmissionPrivateDataEntry(com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry) MultipleConnectionsEntry(com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) DisplayNoneInCSSEntry(com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry) DiagnosticsTab(com.att.aro.ui.view.diagnostictab.DiagnosticsTab) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry) UnnecessaryConnectionEntry(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionEntry) ForwardSecrecyEntry(com.att.aro.core.bestpractice.pojo.ForwardSecrecyEntry) HttpEntry(com.att.aro.core.bestpractice.pojo.HttpEntry) ImageCompressionEntry(com.att.aro.core.bestpractice.pojo.ImageCompressionEntry) UnsecureSSLVersionEntry(com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionEntry) WaterfallTab(com.att.aro.ui.view.waterfalltab.WaterfallTab) SpriteImageEntry(com.att.aro.core.bestpractice.pojo.SpriteImageEntry) Session(com.att.aro.core.packetanalysis.pojo.Session) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Example 80 with Session

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;
}
Also used : SpriteImageResult(com.att.aro.core.bestpractice.pojo.SpriteImageResult) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) SpriteImageEntry(com.att.aro.core.bestpractice.pojo.SpriteImageEntry) Session(com.att.aro.core.packetanalysis.pojo.Session)

Aggregations

Session (com.att.aro.core.packetanalysis.pojo.Session)130 ArrayList (java.util.ArrayList)86 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)74 BaseTest (com.att.aro.core.BaseTest)49 Test (org.junit.Test)49 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)32 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)31 InetAddress (java.net.InetAddress)26 HashMap (java.util.HashMap)19 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)17 HashSet (java.util.HashSet)11 TreeMap (java.util.TreeMap)11 List (java.util.List)10 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)9 File (java.io.File)9 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)8 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)8 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)7 HttpRequestResponseInfoWithSession (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfoWithSession)7 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)7