Search in sources :

Example 1 with TraceDirectoryResult

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

the class HtmlReportImpl method getTraceRows.

private String getTraceRows(PacketAnalyzerResult analyzerResults) {
    StringBuilder sbuilder = new StringBuilder(180);
    AbstractTraceResult traceResults = analyzerResults.getTraceresult();
    if (traceResults != null) {
        sbuilder.append(tableLIne() + "<th>Date</th><td>" + traceResults.getTraceDateTime() + tableChange() + System.getProperty(lineSeperator()));
        // if it is from rooted collector and load from trace trace folder
        TraceResultType traceType = traceResults.getTraceResultType();
        if (TraceResultType.TRACE_DIRECTORY.equals(traceType)) {
            TraceDirectoryResult traceDirResult = (TraceDirectoryResult) traceResults;
            sbuilder.append(tableLIne());
            sbuilder.append("<th>Device Make/Model</th>");
            if (traceDirResult.getDeviceMake() != null && traceDirResult.getDeviceModel() != null) {
                sbuilder.append("<td>" + traceDirResult.getDeviceMake() + " / " + traceDirResult.getDeviceModel() + "</td>");
            } else {
                sbuilder.append("<p>Not Available</p>");
            }
            sbuilder.append("</tr>");
            sbuilder.append(System.getProperty(lineSeperator()));
            sbuilder.append(tableLIne());
            sbuilder.append("<th>Platform Version</th>");
            if (traceDirResult.getOsType() != null && traceDirResult.getOsVersion() != null) {
                sbuilder.append("<td>" + traceDirResult.getOsType() + " / " + traceDirResult.getOsVersion() + "</td>");
            } else {
                sbuilder.append("<p>Not Available</p>");
            }
            sbuilder.append("</tr>");
            sbuilder.append(System.getProperty(lineSeperator()));
            // Append display resolution
            String displayResolutionValue = String.format("%s (Width: %s, Height: %s)", traceDirResult.getCollectOptions().getOrientation(), String.valueOf(traceDirResult.getDeviceScreenSizeX()), String.valueOf(traceDirResult.getDeviceScreenSizeY()));
            sbuilder.append(tableLIne());
            sbuilder.append("<th>Display Resolution</th>");
            sbuilder.append("<td>" + displayResolutionValue + "</td>");
            sbuilder.append("</tr>");
            sbuilder.append(System.getProperty(lineSeperator()));
        }
    }
    return sbuilder.toString();
}
Also used : AbstractTraceResult(com.att.aro.core.packetanalysis.pojo.AbstractTraceResult) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType)

Example 2 with TraceDirectoryResult

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

the class VideoSegmentAnalyzer method locateStartupDelay.

/**
 * <pre>
 * Loads, and or creates estimated, startup data for a stream Populates
 * VideoStreamStartup from first segment and manifest data. Populates
 * VideoStream so that graphs can be displayed. Attaches to VideoStream to aid
 * SegmentTablePanel
 *
 * @param result
 * @param videoStream
 * @return existing or estimated VideoStreamStartup
 */
public VideoStreamStartup locateStartupDelay(AbstractTraceResult result, VideoStream videoStream) {
    if (result instanceof TraceDirectoryResult) {
        if ((videoStreamStartupData = ((TraceDirectoryResult) result).getVideoStartupData()) != null) {
            if ((videoStreamStartup = findStartupFromName(videoStreamStartupData, videoStream)) != null) {
                if (videoStreamStartup.getValidationStartup().equals(ValidationStartup.NA)) {
                    videoStreamStartup.setValidationStartup(ValidationStartup.USER);
                }
            }
        } else {
            videoStreamStartupData = new VideoStreamStartupData();
        }
        if (videoStreamStartup == null) {
            VideoEvent firstEvent = null;
            videoStreamStartup = new VideoStreamStartup(videoStream.getManifest().getVideoName());
            videoStreamStartup.setValidationStartup(ValidationStartup.ESTIMATED);
            videoStreamStartupData.getStreams().add(videoStreamStartup);
            if (!CollectionUtils.isEmpty(videoStream.getVideoActiveMap())) {
                firstEvent = videoStream.getFirstActiveSegment();
            } else {
                firstEvent = videoStream.getFirstSegment();
                if (firstEvent == null) {
                    // invalid stream, no first segment that is a normal segment
                    return null;
                }
                if (videoStream.getManifest().getRequestTime() == 0.0) {
                    // CSI there is no requestTime so make an estimate
                    videoStream.getManifest().setRequestTime(firstEvent.getRequest().getTimeStamp() - videoPrefs.getStallRecovery());
                }
            }
            if (firstEvent.getPlayRequestedTime() == 0) {
                firstEvent.setPlayRequestedTime(videoStream.getManifest().getRequestTime());
            }
            firstEvent.setStartupOffset(firstEvent.getDLLastTimestamp() + videoPrefs.getStallRecovery());
            videoStreamStartup.setFirstSegID(firstEvent.getSegmentID());
            videoStreamStartup.setManifestReqTime(firstEvent.getManifest().getRequestTime());
            videoStreamStartup.setStartupTime(firstEvent.getStartupOffset());
            if (videoStreamStartup.getUserEvent() == null) {
                UserEvent userEvent = new UserEvent();
                double pressTime = videoStream.getManifest().getRequestTime();
                userEvent.setPressTime(pressTime);
                userEvent.setReleaseTime(pressTime);
                userEvent.setEventType(UserEventType.EVENT_UNKNOWN);
                videoStreamStartup.setUserEvent(userEvent);
            }
        }
        videoStream.getManifest().setDelay(videoStreamStartup.getStartupTime() - videoStreamStartup.getManifestReqTime());
        videoStream.setVideoPlayBackTime(videoStreamStartup.getStartupTime());
        videoStream.setVideoStreamStartup(videoStreamStartup);
        ((TraceDirectoryResult) result).setVideoStartupData(videoStreamStartupData);
    }
    return videoStreamStartup;
}
Also used : VideoStreamStartup(com.att.aro.core.peripheral.pojo.VideoStreamStartup) VideoStreamStartupData(com.att.aro.core.peripheral.pojo.VideoStreamStartupData) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) VideoEvent(com.att.aro.core.videoanalysis.pojo.VideoEvent) UserEvent(com.att.aro.core.peripheral.pojo.UserEvent)

Example 3 with TraceDirectoryResult

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

the class MainFrame method refresh.

public void refresh() {
    if (aroController != null) {
        AROTraceData traceData = aroController.getTheModel();
        if (traceData.isSuccess()) {
            try {
                modelObserver.refreshModel(traceData);
                this.profile = traceData.getAnalyzerResult().getProfile();
                if (traceData.getAnalyzerResult().getTraceresult().getTraceResultType() == TraceResultType.TRACE_DIRECTORY) {
                    TraceDirectoryResult traceResults = (TraceDirectoryResult) traceData.getAnalyzerResult().getTraceresult();
                    (new Thread(() -> sendGATraceParams(traceResults))).start();
                    Util.updateRecentItem(traceResults.getTraceDirectory());
                    frmApplicationResourceOptimizer.setJMenuBar(mainMenu.getAROMainFileMenu());
                    frmApplicationResourceOptimizer.getJMenuBar().updateUI();
                }
            } catch (OutOfMemoryError err) {
                LOG.error("Out of memory exception after a successful trace analysis", err);
                Util.restart(true);
            }
        } else if (traceData.getError() != null) {
            LOG.info("Error code details: " + traceData.getError());
            if (isUpdateRequired(traceData.getError().getCode())) {
                Util.updateRecentItem(tracePath);
            }
            tracePath = null;
            if (aroSwingWorker != null) {
                aroSwingWorker.cancel(true);
                try {
                    Thread.sleep(150);
                } catch (Exception exc) {
                    LOG.info("Thread sleep exception");
                }
            }
            if (ErrorCodeEnum.OUT_OF_MEMEORY.getCode() == traceData.getError().getCode()) {
                Util.restart(true);
            } else {
                MessageDialogFactory.getInstance().showErrorDialog(window.getJFrame(), traceData.getError().getDescription());
            }
        } else {
            showErrorMessage("menu.error.unknownfileformat");
        }
    }
}
Also used : TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) AROTraceData(com.att.aro.core.pojo.AROTraceData) IOException(java.io.IOException)

Example 4 with TraceDirectoryResult

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

the class BpTestStatisticsPanel method refresh.

@Override
public void refresh(AROTraceData model) {
    PacketAnalyzerResult analyzerResults = model.getAnalyzerResult();
    // Total Data Transferred\:
    totalDataLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.totalDataTransferedValue"), intFormat.format(analyzerResults.getStatistic().getTotalByte())));
    // Total Payload Data Transferred\:
    totalPayloadDataLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.totalPayloadDataValue"), intFormat.format(analyzerResults.getStatistic().getTotalPayloadBytes())));
    // Duration:
    String duration = decFormat.format(analyzerResults.getTraceresult().getTraceDuration() / 60);
    durationLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.durationValue"), duration));
    // Energy Consumed:
    energyConsumedLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.energyConsumedValue"), decFormat.format(analyzerResults.getEnergyModel().getTotalEnergyConsumed())));
    // Attenuator :
    if (TraceResultType.TRACE_DIRECTORY.equals(model.getAnalyzerResult().getTraceresult().getTraceResultType())) {
        TraceDirectoryResult traceResult = (TraceDirectoryResult) model.getAnalyzerResult().getTraceresult();
        CollectOptions collectOptions = traceResult.getCollectOptions();
        if (collectOptions != null) {
            setSpeedThrottleValue(collectOptions);
        }
    } else {
        clearSpeedThrottleValue();
    }
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)

Example 5 with TraceDirectoryResult

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

the class WakeLockPlot method populate.

@Override
public void populate(XYPlot plot, AROTraceData analysis) {
    XYIntervalSeriesCollection wakelockData = new XYIntervalSeriesCollection();
    if (analysis == null) {
        LOGGER.info("analysis data is null");
    } else {
        TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
        if (resultType.equals(TraceResultType.TRACE_FILE)) {
            LOGGER.info("didn't get analysis trace data!");
        } else {
            TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
            XYIntervalSeries series = new XYIntervalSeries(WakelockState.WAKELOCK_ACQUIRED);
            wakelockData.addSeries(series);
            // Populate the data set
            Iterator<WakelockInfo> iter = traceresult.getWakelockInfos().iterator();
            if (iter.hasNext()) {
                WakelockInfo lastEvent = iter.next();
                LOGGER.debug("Wakelock Plotting");
                // Check whether WAKELOCK was acquired before logging begins.
                if (lastEvent.getWakelockState() == WakelockState.WAKELOCK_RELEASED) {
                    series.add(0, 0, lastEvent.getBeginTimeStamp(), 0.5, 0, 1);
                    dataMap.put(lastEvent.getBeginTimeStamp(), lastEvent);
                }
                while (iter.hasNext()) {
                    WakelockInfo currEvent = iter.next();
                    if (lastEvent.getWakelockState() == WakelockState.WAKELOCK_ACQUIRED) {
                        LOGGER.debug("Wakelock acquired curr " + currEvent.getBeginTimeStamp());
                        LOGGER.debug("Wakelock acquired last " + lastEvent.getBeginTimeStamp());
                        series.add(lastEvent.getBeginTimeStamp(), lastEvent.getBeginTimeStamp(), currEvent.getBeginTimeStamp(), 0.5, 0, 1);
                        dataMap.put(lastEvent.getBeginTimeStamp(), lastEvent);
                    }
                    lastEvent = currEvent;
                }
                if (lastEvent.getWakelockState() == WakelockState.WAKELOCK_ACQUIRED) {
                    series.add(lastEvent.getBeginTimeStamp(), lastEvent.getBeginTimeStamp(), traceresult.getTraceDuration(), 0.5, 0, 1);
                    dataMap.put(lastEvent.getBeginTimeStamp(), lastEvent);
                }
            }
            // Assign ToolTip to renderer
            XYItemRenderer renderer = plot.getRenderer();
            renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {

                @Override
                public String generateToolTip(XYDataset dataset, int series, int item) {
                    WakelockInfo wi = dataMap.get(dataset.getXValue(series, item));
                    if (wi != null) {
                        StringBuffer displayInfo = new StringBuffer(ResourceBundleHelper.getMessageString("wakelock.tooltip.prefix"));
                        displayInfo.append(MessageFormat.format(ResourceBundleHelper.getMessageString("wakelock.tooltip.content"), ResourceBundleHelper.getEnumString(wi.getWakelockState()), wi.getBeginTimeStamp()));
                        displayInfo.append(ResourceBundleHelper.getMessageString("wakelock.tooltip.suffix"));
                        return displayInfo.toString();
                    }
                    return null;
                }
            });
        }
    }
    plot.setDataset(wakelockData);
// return plot;
}
Also used : TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType) XYIntervalSeriesCollection(org.jfree.data.xy.XYIntervalSeriesCollection) XYIntervalSeries(org.jfree.data.xy.XYIntervalSeries) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) XYDataset(org.jfree.data.xy.XYDataset) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator) WakelockInfo(com.att.aro.core.peripheral.pojo.WakelockInfo)

Aggregations

TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)51 ArrayList (java.util.ArrayList)16 BaseTest (com.att.aro.core.BaseTest)14 Test (org.junit.Test)14 TraceResultType (com.att.aro.core.packetanalysis.pojo.TraceResultType)13 XYToolTipGenerator (org.jfree.chart.labels.XYToolTipGenerator)10 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)10 XYDataset (org.jfree.data.xy.XYDataset)10 Session (com.att.aro.core.packetanalysis.pojo.Session)9 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)8 CollectOptions (com.att.aro.core.peripheral.pojo.CollectOptions)7 XYIntervalSeries (org.jfree.data.xy.XYIntervalSeries)7 XYSeries (org.jfree.data.xy.XYSeries)7 AbstractTraceResult (com.att.aro.core.packetanalysis.pojo.AbstractTraceResult)5 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)5 File (java.io.File)5 IHttpRequestResponseHelper (com.att.aro.core.packetanalysis.IHttpRequestResponseHelper)4 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)4 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)4 IOException (java.io.IOException)4