Search in sources :

Example 1 with VideoStallResult

use of com.att.aro.core.bestpractice.pojo.VideoStallResult in project VideoOptimzer by attdevsupport.

the class VideoResultSummary method populateSummary.

private void populateSummary(AROTraceData trace) {
    for (AbstractBestPracticeResult bpResult : trace.getBestPracticeResults()) {
        if (bpResult.getClass().getName().contains("AROServiceImpl")) {
            continue;
        }
        BestPracticeType bpType = bpResult.getBestPracticeType();
        switch(bpType) {
            case VIDEO_STALL:
                VideoStallResult result = (VideoStallResult) bpResult;
                stalls = result.getStallResult();
                break;
            case NETWORK_COMPARISON:
                VideoNetworkComparisonResult ntkResult = (VideoNetworkComparisonResult) bpResult;
                ntkComparison = ntkResult.getAvgKbps();
                break;
            case TCP_CONNECTION:
                VideoTcpConnectionResult tcpResult = (VideoTcpConnectionResult) bpResult;
                tcpConnection = tcpResult.getTcpConnections();
                break;
            case BUFFER_OCCUPANCY:
                BufferOccupancyResult bufferResult = (BufferOccupancyResult) bpResult;
                bufferOccupancy = bufferResult.getMaxBuffer();
                populateBufferResult(bufferResult);
                break;
            case CHUNK_SIZE:
                VideoChunkSizeResult segmentSizeResult = (VideoChunkSizeResult) bpResult;
                segmentSize = segmentSizeResult.getSegmentSize();
                segmentCount = segmentSizeResult.getSegmentCount();
                break;
            case CHUNK_PACING:
                VideoChunkPacingResult segmentPacingResult = (VideoChunkPacingResult) bpResult;
                segmentPacing = segmentPacingResult.getChunkPacing();
                break;
            case VIDEO_REDUNDANCY:
                VideoRedundancyResult redundancyResult = (VideoRedundancyResult) bpResult;
                duplicate = redundancyResult.getCountDuplicate();
                redundancy = redundancyResult.getRedundantPercentage();
                break;
            case STARTUP_DELAY:
                VideoStartUpDelayResult startupDelayResult = (VideoStartUpDelayResult) bpResult;
                startUpDelay = startupDelayResult.getStartUpDelay();
                break;
            case VIDEO_CONCURRENT_SESSION:
                VideoConcurrentSessionResult concurrentSessionResult = (VideoConcurrentSessionResult) bpResult;
                concurrentSessions = concurrentSessionResult.getMaxConcurrentSessionCount();
                break;
            default:
                break;
        }
    }
    List<Session> allSessions = trace.getAnalyzerResult().getSessionlist();
    Map<InetAddress, List<Session>> ipSessionsMap = new HashMap<InetAddress, List<Session>>();
    for (Session session : allSessions) {
        InetAddress ipAddress = session.getRemoteIP();
        if (ipSessionsMap.containsKey(ipAddress)) {
            ipSessionsMap.get(ipAddress).add(session);
        } else {
            List<Session> sess = new ArrayList<Session>();
            sess.add(session);
            ipSessionsMap.put(ipAddress, sess);
        }
    }
    ipAddress = ipSessionsMap.keySet().size();
    ipSessions = allSessions.size();
    StreamingVideoData streamingVideoData;
    if ((streamingVideoData = trace.getAnalyzerResult().getStreamingVideoData()) == null) {
        return;
    }
    Collection<VideoStream> selectedVideoStreams = streamingVideoData.getVideoStreams();
    movieMBytes = calculateMBytes(selectedVideoStreams, false);
    totalMBytes = calculateMBytes(selectedVideoStreams, true);
    if (trace.getAnalyzerResult().getStreamingVideoData().getStreamingVideoCompiled().getChunkPlayTimeList().isEmpty()) {
        startupDelayStatus = false;
    } else {
        startupDelayStatus = true;
    }
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) HashMap(java.util.HashMap) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) ArrayList(java.util.ArrayList) VideoStream(com.att.aro.core.videoanalysis.pojo.VideoStream) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) StreamingVideoData(com.att.aro.core.videoanalysis.pojo.StreamingVideoData) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) ArrayList(java.util.ArrayList) List(java.util.List) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) InetAddress(java.net.InetAddress) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 2 with VideoStallResult

use of com.att.aro.core.bestpractice.pojo.VideoStallResult in project VideoOptimzer by attdevsupport.

the class VideoStallImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    List<VideoStall> videoStallResult = tracedata.getVideoStalls();
    List<VideoStall> stallResult = new ArrayList<VideoStall>();
    result = new VideoStallResult();
    init(result);
    if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
        bpResultType = BPResultType.CONFIG_REQUIRED;
        result.setResultExcelText(BPResultType.CONFIG_REQUIRED.getDescription());
        selectedManifestCount = streamingVideoData.getSelectedManifestCount();
        hasSelectedManifest = (selectedManifestCount > 0);
        invalidCount = streamingVideoData.getInvalidManifestCount();
        if (selectedManifestCount == 0) {
            if (invalidCount == videoStreamCollection.size()) {
                result.setResultText(invalidManifestsFound);
            } else if (invalidCount > 0) {
                result.setResultText(noManifestsSelectedMixed);
            } else {
                result.setResultText(noManifestsSelected);
            }
        } else if (selectedManifestCount > 1) {
            result.setResultText(multipleManifestsSelected);
        } else if (hasSelectedManifest) {
            bpResultType = BPResultType.SELF_TEST;
            double stallTriggerTime = videoPref.getVideoUsagePreference().getStallTriggerTime();
            int stallCount = 0;
            if (videoStallResult != null) {
                for (VideoStall stall : videoStallResult) {
                    if (stall.getDuration() >= stallTriggerTime) {
                        stallCount++;
                        stallResult.add(updateStallResult(stall));
                    }
                }
            }
            int count = 0;
            if (warningCount != 0 || failCount != 0) {
                if (failCount > 0) {
                    bpResultType = BPResultType.FAIL;
                    count = failCount;
                } else if (warningCount > 0) {
                    bpResultType = BPResultType.WARNING;
                    count = warningCount;
                }
            } else {
                bpResultType = BPResultType.PASS;
                count = passCount;
            }
            double startupDelay = videoPref.getVideoUsagePreference().getStartupDelay();
            if (MapUtils.isEmpty(streamingVideoData.getStreamingVideoCompiled().getChunkPlayTimeList())) {
                // Meaning startup delay is not set yet
                bpResultType = BPResultType.CONFIG_REQUIRED;
                result.setResultText(MessageFormat.format(startUpDelayNotSet, startupDelay, startupDelay == 1 ? "" : "s"));
                result.setResultExcelText(BPResultType.CONFIG_REQUIRED.getDescription());
            } else {
                result.setResultText(MessageFormat.format(this.textResults, stallCount, stallCount == 1 ? "" : "s", count == 1 ? "was" : "were", count, count == 1 ? "" : "s", bpResultType.toString().toLowerCase()));
                switch(bpResultType) {
                    case PASS:
                        result.setResultExcelText(BPResultType.PASS.getDescription());
                        break;
                    case SELF_TEST:
                        result.setResultExcelText(BPResultType.SELF_TEST.getDescription());
                    case WARNING:
                    case FAIL:
                        result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), stallCount));
                        break;
                    default:
                        break;
                }
            }
            result.setVideoStallResult(stallCount);
            result.setResults(stallResult);
        }
    } else {
        result.setResultText(noData);
        bpResultType = BPResultType.NO_DATA;
        result.setResultExcelText(BPResultType.NO_DATA.getDescription());
    }
    result.setResultType(bpResultType);
    return result;
}
Also used : ArrayList(java.util.ArrayList) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Example 3 with VideoStallResult

use of com.att.aro.core.bestpractice.pojo.VideoStallResult in project VideoOptimzer by attdevsupport.

the class VideoBestPractices method analyze.

public AROTraceData analyze(AROTraceData traceDataresult) {
    PacketAnalyzerResult result = null;
    if (null == traceDataresult) {
        return null;
    }
    result = traceDataresult.getAnalyzerResult();
    if (result == null) {
        return null;
    }
    VideoStallResult videoStallResult = null;
    VideoStartUpDelayResult videoStartUpDelayResult = null;
    BufferOccupancyResult bufferOccupancyResult = null;
    VideoNetworkComparisonResult videoNetworkComparisonResult = null;
    VideoTcpConnectionResult videoTcpConnectionResult = null;
    VideoChunkSizeResult videoChunkSizeResult = null;
    VideoChunkPacingResult videoChunkPacingResult = null;
    VideoRedundancyResult videoRedundancyResult = null;
    VideoConcurrentSessionResult videoConcurrentSessionResult = null;
    VideoVariableBitrateResult videoVariableBitrateResult = null;
    VideoAdaptiveBitrateLadderResult videoSegmentQualityResult = null;
    VideoResolutionQualityResult videoResolutionQualityResult = null;
    AudioStreamResult videoSeparateAudioResult = null;
    List<BestPracticeType> requests = BestPracticeType.getByCategory(Category.VIDEO);
    List<AbstractBestPracticeResult> bpResults = traceDataresult.getBestPracticeResults();
    List<AbstractBestPracticeResult> videoBestPracticeResults = aroService.analyze(result, requests);
    for (AbstractBestPracticeResult videoBPResult : videoBestPracticeResults) {
        BestPracticeType bpType = videoBPResult.getBestPracticeType();
        switch(bpType) {
            case VIDEO_STALL:
                videoStallResult = (VideoStallResult) videoBPResult;
                break;
            case STARTUP_DELAY:
                videoStartUpDelayResult = (VideoStartUpDelayResult) videoBPResult;
                break;
            case BUFFER_OCCUPANCY:
                bufferOccupancyResult = (BufferOccupancyResult) videoBPResult;
                break;
            case NETWORK_COMPARISON:
                videoNetworkComparisonResult = (VideoNetworkComparisonResult) videoBPResult;
                break;
            case TCP_CONNECTION:
                videoTcpConnectionResult = (VideoTcpConnectionResult) videoBPResult;
                break;
            case CHUNK_SIZE:
                videoChunkSizeResult = (VideoChunkSizeResult) videoBPResult;
                break;
            case CHUNK_PACING:
                videoChunkPacingResult = (VideoChunkPacingResult) videoBPResult;
                break;
            case VIDEO_REDUNDANCY:
                videoRedundancyResult = (VideoRedundancyResult) videoBPResult;
                break;
            case VIDEO_CONCURRENT_SESSION:
                videoConcurrentSessionResult = (VideoConcurrentSessionResult) videoBPResult;
                break;
            case VIDEO_VARIABLE_BITRATE:
                videoVariableBitrateResult = (VideoVariableBitrateResult) videoBPResult;
                break;
            case VIDEO_RESOLUTION_QUALITY:
                videoResolutionQualityResult = (VideoResolutionQualityResult) videoBPResult;
                break;
            case VIDEO_ABR_LADDER:
                videoSegmentQualityResult = (VideoAdaptiveBitrateLadderResult) videoBPResult;
                break;
            case AUDIO_STREAM:
                videoSeparateAudioResult = (AudioStreamResult) videoBPResult;
                break;
            default:
                break;
        }
    }
    sendGAVideoBPResult(videoBestPracticeResults);
    for (AbstractBestPracticeResult bestPractice : bpResults) {
        if (bestPractice instanceof VideoStallResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStallResult);
        } else if (bestPractice instanceof VideoStartUpDelayResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoStartUpDelayResult);
        } else if (bestPractice instanceof BufferOccupancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), bufferOccupancyResult);
        } else if (bestPractice instanceof VideoNetworkComparisonResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoNetworkComparisonResult);
        } else if (bestPractice instanceof VideoTcpConnectionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoTcpConnectionResult);
        } else if (bestPractice instanceof VideoChunkSizeResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkSizeResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoChunkPacingResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoChunkPacingResult);
        } else if (bestPractice instanceof VideoRedundancyResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoRedundancyResult);
        } else if (bestPractice instanceof VideoConcurrentSessionResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoConcurrentSessionResult);
        } else if (bestPractice instanceof VideoVariableBitrateResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoVariableBitrateResult);
        } else if (bestPractice instanceof VideoResolutionQualityResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoResolutionQualityResult);
        } else if (bestPractice instanceof VideoAdaptiveBitrateLadderResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSegmentQualityResult);
        } else if (bestPractice instanceof AudioStreamResult) {
            bpResults.set(bpResults.indexOf(bestPractice), videoSeparateAudioResult);
        }
    }
    traceDataresult.setBestPracticeResults(bpResults);
    return traceDataresult;
}
Also used : VideoRedundancyResult(com.att.aro.core.bestpractice.pojo.VideoRedundancyResult) VideoResolutionQualityResult(com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult) VideoNetworkComparisonResult(com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) VideoStallResult(com.att.aro.core.bestpractice.pojo.VideoStallResult) VideoConcurrentSessionResult(com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult) VideoAdaptiveBitrateLadderResult(com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult) VideoTcpConnectionResult(com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult) VideoVariableBitrateResult(com.att.aro.core.bestpractice.pojo.VideoVariableBitrateResult) AudioStreamResult(com.att.aro.core.bestpractice.pojo.AudioStreamResult) BufferOccupancyResult(com.att.aro.core.bestpractice.pojo.BufferOccupancyResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) VideoChunkPacingResult(com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult) VideoStartUpDelayResult(com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult) VideoChunkSizeResult(com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult)

Aggregations

VideoStallResult (com.att.aro.core.bestpractice.pojo.VideoStallResult)3 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)2 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)2 BufferOccupancyResult (com.att.aro.core.bestpractice.pojo.BufferOccupancyResult)2 VideoChunkPacingResult (com.att.aro.core.bestpractice.pojo.VideoChunkPacingResult)2 VideoChunkSizeResult (com.att.aro.core.bestpractice.pojo.VideoChunkSizeResult)2 VideoConcurrentSessionResult (com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult)2 VideoNetworkComparisonResult (com.att.aro.core.bestpractice.pojo.VideoNetworkComparisonResult)2 VideoRedundancyResult (com.att.aro.core.bestpractice.pojo.VideoRedundancyResult)2 VideoStartUpDelayResult (com.att.aro.core.bestpractice.pojo.VideoStartUpDelayResult)2 VideoTcpConnectionResult (com.att.aro.core.bestpractice.pojo.VideoTcpConnectionResult)2 ArrayList (java.util.ArrayList)2 AudioStreamResult (com.att.aro.core.bestpractice.pojo.AudioStreamResult)1 VideoAdaptiveBitrateLadderResult (com.att.aro.core.bestpractice.pojo.VideoAdaptiveBitrateLadderResult)1 VideoResolutionQualityResult (com.att.aro.core.bestpractice.pojo.VideoResolutionQualityResult)1 VideoVariableBitrateResult (com.att.aro.core.bestpractice.pojo.VideoVariableBitrateResult)1 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)1 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)1