Search in sources :

Example 71 with Session

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

the class DLPacketPlot method populate.

// private static final Logger logger = LogManager.getLogger(DLPacketPlot.class.getName());
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
    LinkedHashMap<Color, PacketSeries> dlDatasets = new LinkedHashMap<Color, PacketSeries>();
    AnalysisFilter filter = null;
    // logger.info("isDownloadPacket(): "+ isDownloadPacket());
    if (analysis != null) {
        filter = analysis.getAnalyzerResult().getFilter();
        for (Session session : analysis.getAnalyzerResult().getSessionlist()) {
            addSeries(session, dlDatasets, filter);
        }
    }
    // Create the XY data set
    YIntervalSeriesCollection coll = new YIntervalSeriesCollection();
    XYItemRenderer renderer = plot.getRenderer();
    for (PacketSeries series : dlDatasets.values()) {
        coll.addSeries(series);
        renderer.setSeriesPaint(coll.indexOf(series.getKey()), series.getColor());
    }
    // Create tooltip generator
    renderer.setBaseToolTipGenerator(new PacketToolTipGenerator());
    plot.setDataset(coll);
// return plot;
}
Also used : YIntervalSeriesCollection(org.jfree.data.xy.YIntervalSeriesCollection) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) Color(java.awt.Color) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) LinkedHashMap(java.util.LinkedHashMap) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 72 with Session

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

the class ConnectionsPlot method populate.

public void populate(XYPlot plot, AROTraceData analysis) {
    series = new XYSeries(0);
    if (analysis != null) {
        List<Session> sessionList = analysis.getAnalyzerResult().getSessionlist();
        if (sessionList != null && sessionList.size() > 0) {
            calculateSimultConnections(sessionList);
        } else {
            return;
        }
    }
    plot.setDataset(new XYSeriesCollection(series));
    plot.getRenderer().setBaseToolTipGenerator(new XYToolTipGenerator() {

        @Override
        public String generateToolTip(XYDataset dataset, int series, int item) {
            // Tooltip displays no of connections
            return item < toolTipList.size() ? toolTipList.get(item) : "";
        }
    });
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) 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 73 with Session

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

the class ConnectionStatisticsChartPanel method generateDataForChart.

private ConnectionStatisticsInfo generateDataForChart() {
    ConnectionStatisticsInfo connectionStatisticsPojo = new ConnectionStatisticsInfo();
    double sessionTermPct = 0.0;
    int longBurstCount = 0;
    if (traceDataModel != null && traceDataModel.getAnalyzerResult() != null) {
        int termSessions = 0;
        int properTermSessions = 0;
        for (Session tcpSession : traceDataModel.getAnalyzerResult().getSessionlist()) {
            if (!tcpSession.isUdpOnly()) {
                Termination termination = tcpSession.getSessionTermination();
                if (termination != null) {
                    ++termSessions;
                    if (termination.getSessionTerminationDelay() <= SESSION_TERMINATION_THRESHOLD) {
                        ++properTermSessions;
                    }
                }
            }
        }
        if (termSessions > 0) {
            sessionTermPct = 100.0 * properTermSessions / termSessions;
        }
        longBurstCount = traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getLongBurstCount();
    }
    connectionStatisticsPojo.setSessionTermPct(sessionTermPct);
    double tightlyCoupledTCPPct = 0.0;
    if (traceDataModel != null && traceDataModel.getAnalyzerResult() != null) {
        int burstSize = traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getBurstCollection().size();
        int periodicBurstCount = 0;
        for (Burst burstInfo : traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getBurstCollection()) {
            BurstCategory bCategory = burstInfo.getBurstCategory();
            if (bCategory == BurstCategory.PERIODICAL) {
                periodicBurstCount += 1;
            }
        }
        double nonPeriodicBurstPct = 100 - 100.0 * periodicBurstCount / burstSize;
        connectionStatisticsPojo.setNonPeriodicBurstPct(nonPeriodicBurstPct);
        int tightlyCoupledBurstCount = 0;
        for (AbstractBestPracticeResult abstractResult : traceDataModel.getBestPracticeResults()) {
            if (abstractResult.getBestPracticeType().equals(BestPracticeType.UNNECESSARY_CONNECTIONS) && abstractResult.getResultType() != BPResultType.NONE) {
                UnnecessaryConnectionResult unnecessaryConnt = (UnnecessaryConnectionResult) abstractResult;
                tightlyCoupledBurstCount = unnecessaryConnt.getTightlyCoupledBurstCount();
            }
        }
        tightlyCoupledTCPPct = 100.0 * tightlyCoupledBurstCount / burstSize;
        connectionStatisticsPojo.setTightlyCoupledTCPPct(tightlyCoupledTCPPct);
        double longBurstPct = 0.0;
        longBurstPct = 100.0 * longBurstCount / burstSize;
        connectionStatisticsPojo.setLongBurstPct(longBurstPct);
    }
    return connectionStatisticsPojo;
}
Also used : UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) BurstCategory(com.att.aro.core.packetanalysis.pojo.BurstCategory) ConnectionStatisticsInfo(com.att.aro.ui.model.overview.ConnectionStatisticsInfo) Burst(com.att.aro.core.packetanalysis.pojo.Burst) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Termination(com.att.aro.core.packetanalysis.pojo.Termination) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 74 with Session

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

the class FileTypesChartPanel method generateDataForChart.

/**
 * Creates the FilTypes list to be plotted on the chart.
 * @return
 */
private void generateDataForChart() {
    Map<String, FileTypeSummary> content = new HashMap<String, FileTypeSummary>();
    int totalContentLength = 0;
    if (traceDataModel != null && traceDataModel.getAnalyzerResult() != null) {
        for (Session tcp : traceDataModel.getAnalyzerResult().getSessionlist()) {
            if (!tcp.isUdpOnly()) {
                for (HttpRequestResponseInfo info : tcp.getRequestResponseInfo()) {
                    if (HttpDirection.RESPONSE.equals(info.getDirection())) {
                        long contentLength = info.getContentLength();
                        if (contentLength > 0) {
                            String contentType = info.getContentType();
                            if (contentType == null || contentType.isEmpty()) {
                                contentType = ResourceBundleHelper.getMessageString("chart.filetype.unknown");
                            }
                            FileTypeSummary summary = content.get(contentType);
                            if (summary == null) {
                                summary = new FileTypeSummary(contentType);
                                content.put(contentType, summary);
                            }
                            // summary.bytes += contentLength;
                            summary.setBytes(summary.getBytes() + contentLength);
                            totalContentLength += contentLength;
                        }
                    }
                }
            }
        }
    }
    List<FileTypeSummary> result = new ArrayList<FileTypeSummary>(content.values());
    Collections.sort(result);
    if (result.size() > MAX_LIMIT_FILETYPES) {
        long otherValuesTotal = 0;
        Iterator<FileTypeSummary> iterator = result.iterator();
        for (int index = 0; index < (MAX_LIMIT_FILETYPES - 1); index++) {
            iterator.next();
        }
        while (iterator.hasNext()) {
            otherValuesTotal += iterator.next().getBytes();
            iterator.remove();
        }
        FileTypeSummary other = new FileTypeSummary(ResourceBundleHelper.getMessageString("chart.filetype.others"));
        other.setBytes(otherValuesTotal);
        result.add(other);
        // Sort again
        Collections.sort(result);
    }
    for (FileTypeSummary summary : result) {
        summary.setPct((double) summary.getBytes() / totalContentLength * 100.0);
    }
    this.setFileTypeContent(result);
}
Also used : HashMap(java.util.HashMap) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) FileTypeSummary(com.att.aro.ui.model.overview.FileTypeSummary) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 75 with Session

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

the class OverviewTabTableSplitPane method loadAccessedDomainsTable.

private void loadAccessedDomainsTable() {
    List<Session> tcpSessions = new ArrayList<Session>();
    for (Session tcpSession : this.getAroModel().getAnalyzerResult().getSessionlist()) {
        if (!tcpSession.isUdpOnly()) {
            tcpSessions.add(tcpSession);
        }
    }
    accessDomainModel.setData(DomainsTCPSessions.extractDomainTcpSessions(tcpSessions));
}
Also used : ArrayList(java.util.ArrayList) 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