Search in sources :

Example 66 with HttpRequestResponseInfo

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

the class VideoRequestPanel method getRequestListPanel.

private JPanel getRequestListPanel() {
    if (requestListPanel == null) {
        requestListPanel = new JPanel();
        requestListPanel.setLayout(new BorderLayout());
        getDummyData();
        requestListTable = new DataTable<HttpRequestResponseInfo>();
        requestListPanel.setName(ResourceBundleHelper.getMessageString("video.tab.requests.tableName"));
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) requestListTable.getPopup();
        popupMenu.initialize();
        videoRequestTableModel.setData(requestURL);
        requestListTable.setModel(videoRequestTableModel);
        JTableHeader header = requestListTable.getTableHeader();
        requestListTable.setGridColor(Color.LIGHT_GRAY);
        int width = requestListTable.getParent() != null ? requestListTable.getParent().getWidth() : 1000;
        width = requestPanel.getWidth();
        requestListTable.getColumnModel().getColumn(0).setPreferredWidth(width);
        requestListTable.getColumnModel().getColumn(0).setCellRenderer(new WordWrapRenderer());
        requestListPanel.add(header, BorderLayout.NORTH);
        requestListPanel.add(requestListTable, BorderLayout.CENTER);
        requestListTable.addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent event) {
                if (event.getClickCount() == 2) {
                    int row = requestListTable.getSelectedRow();
                    HttpRequestResponseInfo request = requestURL.get(row);
                    requestListTable.getColumnModel().getColumn(0).setCellRenderer(new WordWrapRenderer(row));
                    if (ResourceBundleHelper.getMessageString("videotab.videorequest.table.url").equals(requestListTable.getColumnName(requestListTable.getSelectedColumn()))) {
                        RegexWizard regexWizard = RegexWizard.getInstance(aroView.getJFrame());
                        regexWizard.setRequest(request);
                        regexWizard.setVisible(true);
                    }
                }
            }
        });
    }
    return requestListPanel;
}
Also used : JPanel(javax.swing.JPanel) MouseEvent(java.awt.event.MouseEvent) BorderLayout(java.awt.BorderLayout) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) MouseAdapter(java.awt.event.MouseAdapter) JTableHeader(javax.swing.table.JTableHeader) RegexWizard(com.att.aro.ui.view.menu.tools.RegexWizard)

Example 67 with HttpRequestResponseInfo

use of com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo 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 68 with HttpRequestResponseInfo

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

the class VideoRequestPanel method refresh.

@Override
public void refresh(AROTraceData analyzerResult) {
    requestURL = new ArrayList<>();
    if (analyzerResult != null && analyzerResult.getAnalyzerResult() != null && analyzerResult.getAnalyzerResult().getStreamingVideoData() != null) {
        for (HttpRequestResponseInfo req : analyzerResult.getAnalyzerResult().getStreamingVideoData().getRequestMap().values()) {
            requestURL.add(req);
        }
    }
    videoRequestTableModel.setData(requestURL);
    requestPanel.remove(requestListPanel);
    requestListPanel = getRequestListPanel();
    requestPanel.add(getRequestListPanel(), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
    requestPanel.updateUI();
    resize();
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)

Example 69 with HttpRequestResponseInfo

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

the class WaterfallPopup method refresh.

// TODO find how to do refresh...once we get the data.
/**
 * Refreshes the popup window with data from the specified request/response
 * @param req The request/response pair.  Direction must be REQUEST and
 * response will be read from request.
 */
public void refresh(HttpRequestResponseInfo req, int index) {
    if (req == null) {
        this.setVisible(false);
    } else {
        this.setAlwaysOnTop(true);
        this.setTitle(MessageFormat.format(ResourceBundleHelper.getMessageString("waterfall.popupTitle"), index));
        // Check to see if request/response is already displayed
        if (req.equals(reqResp)) {
            return;
        }
        // Check for valid argument - only HTTP requests
        if (req.getDirection() != HttpDirection.REQUEST || req.getWaterfallInfos() == null) {
            throw new IllegalArgumentException("Invalid request object");
        }
        RequestResponseTimeline rrTimeLine = req.getWaterfallInfos();
        HttpRequestResponseInfo resp = req.getAssocReqResp();
        NumberFormat secFmt = NumberFormat.getNumberInstance();
        secFmt.setMaximumFractionDigits(3);
        NumberFormat kbFmt = NumberFormat.getNumberInstance();
        kbFmt.setMaximumFractionDigits(1);
        if (req.getObjUri() == null) {
            urlValueLabel.setText(req.getObjName());
        } else {
            urlValueLabel.setText(req.getObjUri().toString());
        }
        // urlValueLabel.setText(req.getObjUri() != null ? req.getObjUri().toString() : req.getObjName());
        hostValueLabel.setText(req.getHostName());
        // ipValueLabel.setText(req.getSession().getRemoteIP().getHostAddress());
        ipValueLabel.setText(req.getFirstDataPacket().getRemoteIPAddress().getHostAddress());
        if (resp.getStatusLine() == null) {
            statusValueLabel.setText(ResourceBundleHelper.getMessageString("waterfall.unknownCode"));
        } else {
            statusValueLabel.setText(resp.getStatusLine());
        }
        // statusValueLabel.setText(resp.getStatusLine() != null ? resp.getStatusLine() : ResourceBundleHelper.getMessageString("waterfall.unknownCode"));
        startValueLabel.setText(MessageFormat.format(W_SECONDS, secFmt.format(rrTimeLine.getStartTime())));
        refreshWaterfallLabel(dnsValueLabel, rrTimeLine.getDnsLookupDuration());
        refreshWaterfallLabel(initConnValueLabel, rrTimeLine.getInitialConnDuration());
        refreshWaterfallLabel(sslValueLabel, rrTimeLine.getSslNegotiationDuration());
        refreshWaterfallLabel(reqTimeValueLabel, rrTimeLine.getRequestDuration());
        refreshWaterfallLabel(firstByteValueLabel, rrTimeLine.getTimeToFirstByte());
        refreshWaterfallLabel(contentValueLabel, rrTimeLine.getContentDownloadDuration());
        bytesInValueLabel.setText(MessageFormat.format(W_KB, kbFmt.format(resp.getRawSizeInKB())));
        bytesOutValueLabel.setText(MessageFormat.format(W_KB, kbFmt.format(req.getRawSizeInKB())));
        getRequestPanel().refresh(req);
        getResponsePanel().refresh(resp);
    }
    this.reqResp = req;
}
Also used : RequestResponseTimeline(com.att.aro.core.packetanalysis.pojo.RequestResponseTimeline) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) NumberFormat(java.text.NumberFormat)

Example 70 with HttpRequestResponseInfo

use of com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo 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

HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)108 Session (com.att.aro.core.packetanalysis.pojo.Session)74 ArrayList (java.util.ArrayList)62 BaseTest (com.att.aro.core.BaseTest)40 Test (org.junit.Test)40 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)29 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)14 IOException (java.io.IOException)10 HashMap (java.util.HashMap)10 TreeMap (java.util.TreeMap)10 File (java.io.File)9 IHttpRequestResponseHelper (com.att.aro.core.packetanalysis.IHttpRequestResponseHelper)5 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)5 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)5 URISyntaxException (java.net.URISyntaxException)5 List (java.util.List)5 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)4 RequestResponseTimeline (com.att.aro.core.packetanalysis.pojo.RequestResponseTimeline)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 InetAddress (java.net.InetAddress)4