Search in sources :

Example 51 with PacketInfo

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

the class DiagnosticTabHelper method getBestMatchingPacketInTcpSession.

/**
 * Provides the Best matching packet info from the provided tcp session.
 */
PacketInfo getBestMatchingPacketInTcpSession(Session tcpSession, boolean bExactMatch, double timeStamp, double dTimeRangeInterval) {
    // Try to eliminate session before iterating through packets
    if (!tcpSession.isUdpOnly()) {
        if (tcpSession.getSessionStartTime() > timeStamp || tcpSession.getSessionEndTime() < timeStamp) {
            return null;
        }
    } else {
        if (tcpSession.getUDPSessionStartTime() > timeStamp || tcpSession.getUDPSessionEndTime() < timeStamp) {
            return null;
        }
    }
    double packetTimeStamp = 0.0;
    PacketInfo matchedPacket = null;
    if (!tcpSession.isUdpOnly()) {
        for (PacketInfo p : tcpSession.getTcpPackets()) {
            packetTimeStamp = p.getTimeStamp();
            if ((bExactMatch && (packetTimeStamp == timeStamp)) || ((packetTimeStamp >= (timeStamp - dTimeRangeInterval)) && (packetTimeStamp <= (timeStamp + dTimeRangeInterval)))) {
                matchedPacket = p;
            }
        }
    } else {
        for (PacketInfo p : tcpSession.getUdpPackets()) {
            packetTimeStamp = p.getTimeStamp();
            if ((bExactMatch && (packetTimeStamp == timeStamp)) || ((packetTimeStamp >= (timeStamp - dTimeRangeInterval)) && (packetTimeStamp <= (timeStamp + dTimeRangeInterval)))) {
                matchedPacket = p;
            }
        }
    }
    return matchedPacket;
}
Also used : PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo)

Example 52 with PacketInfo

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

the class GraphPanel method refresh.

// In 4.1.1, the method name is resetChart(TraceData.Analysis analysis)
public void refresh(AROTraceData aroTraceData) {
    getSaveGraphButton().setEnabled(aroTraceData != null);
    if (combinedPlot != null) {
        setGraphView(combinedPlot.getDomainCrosshairValue(), true);
    } else {
        setGraphView(0, true);
    }
    setTraceData(aroTraceData);
    if (aroTraceData != null) {
        setAllPackets(aroTraceData.getAnalyzerResult().getTraceresult().getAllpackets());
        setTraceDuration(aroTraceData.getAnalyzerResult().getTraceresult().getTraceDuration());
        // list
        setAllTcpSessions(aroTraceData.getAnalyzerResult().getSessionlist().size());
    // length
    } else {
        setAllPackets(new LinkedList<PacketInfo>());
        setTraceDuration(0);
        setAllTcpSessions(0);
    }
    if (aroTraceData != null && aroTraceData.getAnalyzerResult().getFilter() != null && aroTraceData.getAnalyzerResult().getFilter().getTimeRange() != null) {
        if (aroTraceData.getAnalyzerResult().getSessionlist().size() > 0 && aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getBeginTime() < aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getEndTime()) {
            getAxis().setRange(new Range(aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getBeginTime(), aroTraceData.getAnalyzerResult().getFilter().getTimeRange().getEndTime()));
        } else {
            getAxis().setRange(new Range(-0.01, 0));
        }
    } else {
        if (getEndTime() > 0) {
            if (aroTraceData != null) {
                getAxis().setRange(new Range(getStartTime(), getEndTime()));
            }
            // Reset times
            setStartTime(0.0);
            setEndTime(0.0);
        } else {
            getAxis().setRange(new Range(-0.01, aroTraceData != null ? aroTraceData.getAnalyzerResult().getTraceresult().getTraceDuration() : DEFAULT_TIMELINE));
        }
    }
    if (aroTraceData != null && aroTraceData.getAnalyzerResult().getSessionlist().size() > 0) {
        for (Map.Entry<ChartPlotOptions, GraphPanelPlotLabels> entry : getSubplotMap().entrySet()) {
            switch(entry.getKey()) {
                case THROUGHPUT:
                    if (throughput == null) {
                        throughput = new ThroughputPlot();
                    }
                    throughput.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BURSTS:
                    if (burstPlot == null) {
                        burstPlot = new BurstPlot();
                    }
                    // burstPlot = new BurstPlot();
                    burstPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case RRC:
                    if (rrcPlot == null) {
                        rrcPlot = new RrcPlot();
                    }
                    rrcPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case USER_INPUT:
                    if (eventPlot == null) {
                        eventPlot = new UserEventPlot();
                    }
                    eventPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case DL_PACKETS:
                    if (dlPlot == null) {
                        dlPlot = new DLPacketPlot();
                    }
                    dlPlot.populate(entry.getValue().getPlot(), aroTraceData, true);
                    break;
                case UL_PACKETS:
                    if (upPlot == null) {
                        upPlot = new DLPacketPlot();
                    }
                    upPlot.populate(entry.getValue().getPlot(), aroTraceData, false);
                    break;
                case ALARM:
                    if (alarmPlot == null) {
                        alarmPlot = new AlarmPlot();
                    }
                    alarmPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case GPS:
                    if (gpsPlot == null) {
                        gpsPlot = new GpsPlot();
                    }
                    gpsPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case RADIO:
                    if (radioPlot == null) {
                        radioPlot = new RadioPlot();
                    }
                    radioPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case CPU:
                    if (cpuPlot == null) {
                        cpuPlot = new CpuPlot();
                    }
                    cpuPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case SCREEN:
                    if (ssPlot == null) {
                        ssPlot = new ScreenStatePlot();
                    }
                    ssPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BATTERY:
                    if (bPlot == null) {
                        bPlot = new BatteryPlot();
                    }
                    bPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case TEMPERATURE:
                    if (tPlot == null) {
                        tPlot = new TemperaturePlot();
                    }
                    tPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case BLUETOOTH:
                    if (bluetoothPlot == null) {
                        bluetoothPlot = new BluetoothPlot();
                    }
                    bluetoothPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case WIFI:
                    if (wPlot == null) {
                        wPlot = new WifiPlot();
                    }
                    wPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case CAMERA:
                    if (cPlot == null) {
                        cPlot = new CameraPlot();
                    }
                    cPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case NETWORK_TYPE:
                    if (ntPlot == null) {
                        ntPlot = new NetworkTypePlot();
                    }
                    ntPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case WAKELOCK:
                    if (wlPlot == null) {
                        wlPlot = new WakeLockPlot();
                    }
                    wlPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case ATTENUATION:
                    if (attnrPlot == null) {
                        attnrPlot = new AttenuatorPlot();
                    }
                    attnrPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case SPEED_THROTTLE:
                    if (stPlot == null) {
                        stPlot = new SpeedThrottlePlot();
                    }
                    stPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case VIDEO_CHUNKS:
                    if (vcPlot == null) {
                        vcPlot = new VideoChunksPlot();
                    }
                    XYPlot bufferOccupancyPlot = getSubplotMap().get(ChartPlotOptions.BUFFER_OCCUPANCY).getPlot();
                    XYPlot bufferTimePlot = getSubplotMap().get(ChartPlotOptions.BUFFER_TIME_OCCUPANCY).getPlot();
                    this.chunkInfo.clear();
                    vcPlot.setBufferOccupancyPlot(bufferOccupancyPlot);
                    vcPlot.setBufferTimePlot(bufferTimePlot);
                    VideoStream selectedStream = null;
                    int count = 0;
                    StreamingVideoData streamingVideoData = aroTraceData.getAnalyzerResult().getStreamingVideoData();
                    if (streamingVideoData != null) {
                        for (VideoStream videoStream : streamingVideoData.getVideoStreamMap().values()) {
                            if (videoStream != null && videoStream.isSelected()) {
                                selectedStream = videoStream;
                                count++;
                            }
                        }
                        if (count == 1 && selectedStream != null && selectedStream.getManifest().getDelay() != 0) {
                            VideoEvent firstSegment = (VideoEvent) selectedStream.getVideoEventsBySegment().toArray()[0];
                            if (selectedStream.getManifest().getVideoFormat() == VideoFormat.MPEG4) {
                                for (VideoEvent video : selectedStream.getVideoEventsBySegment()) {
                                    if (video.getSegmentID() != 0) {
                                        firstSegment = video;
                                        break;
                                    }
                                }
                            }
                            vcPlot.refreshPlot(getSubplotMap().get(ChartPlotOptions.VIDEO_CHUNKS).getPlot(), aroTraceData, selectedStream.getManifest().getDelay() + firstSegment.getEndTS(), firstSegment);
                        } else {
                            vcPlot.populate(entry.getValue().getPlot(), aroTraceData);
                        }
                    }
                    break;
                case CONNECTIONS:
                    connectionsPlot = new ConnectionsPlot();
                    connectionsPlot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                case LATENCY:
                    if (latencyplot == null) {
                        latencyplot = new LatencyPlot();
                    }
                    latencyplot.populate(entry.getValue().getPlot(), aroTraceData);
                    break;
                default:
                    break;
            }
        }
    }
    getZoomInButton().setEnabled(aroTraceData != null);
    getZoomOutButton().setEnabled(aroTraceData != null);
    getSaveGraphButton().setEnabled(aroTraceData != null);
    if (aroTraceData != null) {
        parent.getDeviceNetworkProfilePanel().refresh(aroTraceData);
    }
}
Also used : WifiPlot(com.att.aro.ui.view.diagnostictab.plot.WifiPlot) RadioPlot(com.att.aro.ui.view.diagnostictab.plot.RadioPlot) ThroughputPlot(com.att.aro.ui.view.diagnostictab.plot.ThroughputPlot) TemperaturePlot(com.att.aro.ui.view.diagnostictab.plot.TemperaturePlot) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) BluetoothPlot(com.att.aro.ui.view.diagnostictab.plot.BluetoothPlot) ConnectionsPlot(com.att.aro.ui.view.diagnostictab.plot.ConnectionsPlot) WakeLockPlot(com.att.aro.ui.view.diagnostictab.plot.WakeLockPlot) DLPacketPlot(com.att.aro.ui.view.diagnostictab.plot.DLPacketPlot) ScreenStatePlot(com.att.aro.ui.view.diagnostictab.plot.ScreenStatePlot) BurstPlot(com.att.aro.ui.view.diagnostictab.plot.BurstPlot) AttenuatorPlot(com.att.aro.ui.view.diagnostictab.plot.AttenuatorPlot) SpeedThrottlePlot(com.att.aro.ui.view.diagnostictab.plot.SpeedThrottlePlot) LatencyPlot(com.att.aro.ui.view.diagnostictab.plot.LatencyPlot) RrcPlot(com.att.aro.ui.view.diagnostictab.plot.RrcPlot) CameraPlot(com.att.aro.ui.view.diagnostictab.plot.CameraPlot) NetworkTypePlot(com.att.aro.ui.view.diagnostictab.plot.NetworkTypePlot) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) VideoChunksPlot(com.att.aro.ui.view.diagnostictab.plot.VideoChunksPlot) TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) Range(org.jfree.data.Range) Point(java.awt.Point) BatteryPlot(com.att.aro.ui.view.diagnostictab.plot.BatteryPlot) XYPlot(org.jfree.chart.plot.XYPlot) CombinedDomainXYPlot(org.jfree.chart.plot.CombinedDomainXYPlot) AlarmPlot(com.att.aro.ui.view.diagnostictab.plot.AlarmPlot) GpsPlot(com.att.aro.ui.view.diagnostictab.plot.GpsPlot) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Map(java.util.Map) EnumMap(java.util.EnumMap) TreeMap(java.util.TreeMap) UserEventPlot(com.att.aro.ui.view.diagnostictab.plot.UserEventPlot) CpuPlot(com.att.aro.ui.view.diagnostictab.plot.CpuPlot)

Example 53 with PacketInfo

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

the class ThroughputPlot method populate.

public void populate(XYPlot plot, AROTraceData analysis) {
    XYSeries series = new XYSeries(0);
    if (analysis != null) {
        // Get packet iterators
        List<PacketInfo> packets = analysis.getAnalyzerResult().getTraceresult().getAllpackets();
        final double maxTS = analysis.getAnalyzerResult().getTraceresult().getTraceDuration();
        final List<String> tooltipList = new ArrayList<String>(1000);
        Double zeroTime = null;
        double lastTime = 0.0;
        double startTime = analysis.getAnalyzerResult().getFilter().getTimeRange().getBeginTime();
        for (Throughput t : throughputHelper.calculateThroughput(startTime, maxTS, analysis.getAnalyzerResult().getProfile().getThroughputWindow(), packets)) {
            double time = t.getTime();
            double kbps = t.getKbps();
            if (kbps != 0.0) {
                if (zeroTime != null && zeroTime.doubleValue() != lastTime) {
                    series.add(lastTime, 0.0);
                    tooltipList.add(MessageFormat.format(THROUGHPUT_TOOLTIP, 0.0));
                }
                // Add slot to data set
                series.add(time, kbps);
                tooltipList.add(MessageFormat.format(THROUGHPUT_TOOLTIP, kbps));
                zeroTime = null;
            } else {
                if (zeroTime == null) {
                    // Add slot to data set
                    series.add(time, kbps);
                    tooltipList.add(MessageFormat.format(THROUGHPUT_TOOLTIP, kbps));
                    zeroTime = Double.valueOf(time);
                }
            }
            lastTime = time;
        }
        plot.getRenderer().setBaseToolTipGenerator(new XYToolTipGenerator() {

            @Override
            public String generateToolTip(XYDataset dataset, int series, int item) {
                // Tooltip displays throughput value
                return tooltipList.get(item);
            }
        });
    }
    plot.setDataset(new XYSeriesCollection(series));
// return plot;
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) ArrayList(java.util.ArrayList) Throughput(com.att.aro.core.packetanalysis.pojo.Throughput) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) XYDataset(org.jfree.data.xy.XYDataset) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection)

Example 54 with PacketInfo

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

Example 55 with PacketInfo

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

the class ExcludeTimeRangeAnalysisDialog method hasDataAfterFiltering.

private boolean hasDataAfterFiltering(AnalysisFilter filter) {
    List<PacketInfo> packetsInfoBeforeFilter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getTraceresult().getAllpackets();
    PacketAnalyzerImpl packetAnalyzerImpl = (PacketAnalyzerImpl) ((MainFrame) parent).getController().getAROService().getAnalyzer();
    List<PacketInfo> packetsInfoAfterFilter = packetAnalyzerImpl.filterPackets(filter, packetsInfoBeforeFilter);
    return packetsInfoAfterFilter.size() > 0;
}
Also used : PacketAnalyzerImpl(com.att.aro.core.packetanalysis.impl.PacketAnalyzerImpl) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) MainFrame(com.att.aro.ui.view.MainFrame)

Aggregations

PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)119 ArrayList (java.util.ArrayList)92 BaseTest (com.att.aro.core.BaseTest)63 Test (org.junit.Test)63 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)48 Session (com.att.aro.core.packetanalysis.pojo.Session)33 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)30 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)26 Profile (com.att.aro.core.configuration.pojo.Profile)25 InetAddress (java.net.InetAddress)25 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)21 ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)18 HashSet (java.util.HashSet)16 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)14 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)14 Packet (com.att.aro.core.packetreader.pojo.Packet)11 HashMap (java.util.HashMap)11 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)9 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)9 IPPacket (com.att.aro.core.packetreader.pojo.IPPacket)9