use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult 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;
}
}
use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult in project VideoOptimzer by attdevsupport.
the class VideoConcurrentSessionImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
result = new VideoConcurrentSessionResult();
init(result);
if ((streamingVideoData = tracedata.getStreamingVideoData()) != null && (videoStreamCollection = streamingVideoData.getVideoStreamMap()) != null && MapUtils.isNotEmpty(videoStreamCollection)) {
bpResultType = BPResultType.CONFIG_REQUIRED;
result.setResultExcelText(bpResultType.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;
int maxManifestConcurrentSessions = 0;
List<VideoConcurrentSession> manifestConcurrency = new ArrayList<VideoConcurrentSession>();
manifestConcurrency = manifestConcurrentSessions(videoStreamCollection);
result.setResults(manifestConcurrency);
for (VideoConcurrentSession manifestSession : manifestConcurrency) {
if (maxManifestConcurrentSessions < manifestSession.getConcurrentSessionCount()) {
maxManifestConcurrentSessions = manifestSession.getConcurrentSessionCount();
}
}
result.setMaxConcurrentSessionCount(maxManifestConcurrentSessions);
if (maxManifestConcurrentSessions > 0) {
result.setResultText(MessageFormat.format(textResults, maxManifestConcurrentSessions));
} else {
result.setResultText(nonConcurrent);
}
result.setResultExcelText(MessageFormat.format(textExcelResults, bpResultType.getDescription(), maxManifestConcurrentSessions));
result.setSelfTest(true);
}
} else {
result.setSelfTest(false);
result.setResultText(noData);
bpResultType = BPResultType.NO_DATA;
result.setResultExcelText(bpResultType.getDescription());
}
result.setResultType(bpResultType);
return result;
}
use of com.att.aro.core.bestpractice.pojo.VideoConcurrentSessionResult 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;
}
Aggregations