Search in sources :

Example 66 with Session

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

the class DisplayNoneInCSSImplTest method runTest_ResultIsPass.

@Test
public void runTest_ResultIsPass() {
    Mockito.when(httpRequestInfo06.getDirection()).thenReturn(HttpDirection.RESPONSE);
    Mockito.when(httpRequestInfo06.getContentType()).thenReturn("text/html");
    Mockito.when(httpRequestInfo06.getContentLength()).thenReturn(1);
    Mockito.when(httpRequestInfo06.getAssocReqResp()).thenReturn(httpRequestInfo01);
    Mockito.when(httpRequestInfo06.getObjName()).thenReturn(htmlString);
    displayNoneInCSSImpl.setHttpRequestResponseHelper(reqhelper);
    try {
        Mockito.when(reqhelper.getContentString(any(HttpRequestResponseInfo.class), any(Session.class))).thenReturn(htmlString2);
    } catch (Exception e) {
        e.printStackTrace();
    }
    List<HttpRequestResponseInfo> value = new ArrayList<HttpRequestResponseInfo>();
    value.add(httpRequestInfo06);
    Mockito.when(session03.getRequestResponseInfo()).thenReturn(value);
    List<Session> sessionList = new ArrayList<Session>();
    Mockito.when(session03.getDomainName()).thenReturn("www.google.com");
    sessionList.add(session03);
    Mockito.when(tracedata.getSessionlist()).thenReturn(sessionList);
    AbstractBestPracticeResult testResult = displayNoneInCSSImpl.runTest(tracedata);
    assertEquals(BPResultType.PASS, testResult.getResultType());
}
Also used : HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Session(com.att.aro.core.packetanalysis.pojo.Session) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 67 with Session

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

the class DomainsTCPSessions method extractDomainTcpSessions.

/**
 * @param sessions
 * @return
 */
public static Collection<DomainsTCPSessions> extractDomainTcpSessions(Collection<Session> sessions) {
    if (sessions == null || sessions.size() <= 0) {
        return Collections.emptyList();
    }
    Map<String, ArrayList<Session>> distinctMap = new HashMap<String, ArrayList<Session>>();
    for (Session tcpSession : sessions) {
        if (tcpSession != null) {
            if (!tcpSession.isUdpOnly()) {
                String domainName = tcpSession.getDomainName();
                ArrayList<Session> tempList = distinctMap.get(domainName);
                if (tempList == null) {
                    tempList = new ArrayList<Session>();
                    distinctMap.put(domainName, tempList);
                }
                tempList.add(tcpSession);
            }
        }
    }
    List<DomainsTCPSessions> result = new ArrayList<DomainsTCPSessions>();
    for (Map.Entry<String, ArrayList<Session>> entry : distinctMap.entrySet()) {
        ArrayList<Session> tempList = entry.getValue();
        tempList.trimToSize();
        result.add(new DomainsTCPSessions(entry.getKey(), tempList));
    }
    return result;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 68 with Session

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

the class TCPUDPFlowsTableModel method refresh.

public void refresh(AROTraceData aroTraceData, Font font) {
    this.font = font;
    maxDomainColWidth = 0;
    maxRemoteIpColWidth = 0;
    maxByteCountColWidth = 0;
    List<Session> sessionlist = aroTraceData.getAnalyzerResult().getSessionlist();
    setData(sessionlist);
    getCheckboxMap().clear();
    for (Session session : sessionlist) {
        String sessionKey = getSessionKey(session);
        sessionMap.put(sessionKey, session);
        checkboxMap.put(sessionKey, new Boolean(true));
    }
}
Also used : Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 69 with Session

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

the class LatencyPlot method populate.

@Override
public void populate(XYPlot plot, AROTraceData analysis) {
    series = new XYSeries(0);
    if (analysis != null) {
        List<Session> sessionList = analysis.getAnalyzerResult().getSessionlist();
        List<Session> tooltipList = new ArrayList<Session>(sessionList.size());
        if (sessionList.size() > 0) {
            for (Session session : sessionList) {
                if (session.getLatency() >= 0) {
                    series.add(session.getSessionStartTime(), session.getLatency());
                    tooltipList.add(session);
                }
            }
        } else {
            return;
        }
        plot.setDataset(new XYSeriesCollection(series));
        plot.getRenderer().setBaseToolTipGenerator(new XYToolTipGenerator() {

            @Override
            public String generateToolTip(XYDataset dataset, int series, int item) {
                return item < tooltipList.size() ? getToolTip(tooltipList.get(item)) : "";
            }

            private String getToolTip(Session session) {
                StringBuffer tooltipValue = new StringBuffer();
                tooltipValue.append(String.format("%.3f,%s,%.3f,%.3f", session.getSessionStartTime(), Util.formatDoubleToMicro(session.getLatency()), session.getSynTime(), session.getSynAckTime()));
                String[] value = tooltipValue.toString().split(",");
                return (MessageFormat.format(ResourceBundleHelper.getDefaultBundle().getString("latency.tooltip"), value[0], value[1], value[2], value[3]));
            }
        });
    }
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) ArrayList(java.util.ArrayList) XYDataset(org.jfree.data.xy.XYDataset) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 70 with Session

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

the class DLPacketPlot method addSeries.

private void addSeries(Session session, LinkedHashMap<Color, PacketSeries> dlDatasets, AnalysisFilter filter) {
    Session thisSession = session;
    for (PacketInfo packet : session.getAllPackets()) {
        if (packet.getDir() == null) {
            continue;
        }
        if (isDownloadPacket() && packet.getDir() == PacketDirection.DOWNLINK) {
            // Add the packet to the proper series based on color
            Color color = filter.getPacketColor(packet);
            PacketSeries series = dlDatasets.get(color);
            if (series == null) {
                series = new PacketSeries(color);
                dlDatasets.put(color, series);
            }
            series.add(new PacketDataItem(thisSession, packet));
        } else if (!isDownloadPacket() && packet.getDir() == PacketDirection.UPLINK) {
            // Add the packet to the proper series based on color
            Color color = filter.getPacketColor(packet);
            PacketSeries series = dlDatasets.get(color);
            if (series == null) {
                series = new PacketSeries(color);
                dlDatasets.put(color, series);
            }
            series.add(new PacketDataItem(thisSession, packet));
        } else {
            continue;
        }
    }
}
Also used : Color(java.awt.Color) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) 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