use of com.att.aro.core.bestpractice.pojo.DuplicateContentResult in project VideoOptimzer by attdevsupport.
the class DuplicateContentImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
DuplicateContentResult result = new DuplicateContentResult();
CacheAnalysis cacheAnalysis = tracedata.getCacheAnalysis();
result.setDuplicateContentBytes(cacheAnalysis.getDuplicateContentBytes());
result.setDuplicateContentBytesRatio(cacheAnalysis.getDuplicateContentBytesRatio());
int duplicateContentsize = cacheAnalysis.getDuplicateContent().size();
result.setDuplicateContentsize(duplicateContentsize);
long totalTCPBytes = 0;
if (tracedata.getStatistic() != null) {
totalTCPBytes = tracedata.getStatistic().getTotalTCPPayloadBytes();
}
result.setTotalContentBytes(totalTCPBytes);
List<CacheEntry> caUResult = cacheAnalysis.getDuplicateContent();
result.setDuplicateContentList(caUResult);
int duplicateContentSizeOfUniqueItems = caUResult.size();
result.setDuplicateContentSizeOfUniqueItems(duplicateContentSizeOfUniqueItems);
if (duplicateContentsize <= 3) {
result.setResultType(BPResultType.PASS);
result.setResultText(textResultPass);
result.setResultExcelText(BPResultType.PASS.getDescription());
} else {
result.setResultType(BPResultType.FAIL);
DecimalFormat numf = new DecimalFormat("#.##");
NumberFormat numf2 = NumberFormat.getInstance();
numf2.setMaximumFractionDigits(3);
String text = MessageFormat.format(textResults, numf.format(result.getDuplicateContentBytes() * 100.0 / result.getTotalContentBytes()), result.getDuplicateContentSizeOfUniqueItems(), numf2.format(((double) result.getDuplicateContentBytes()) / DUPLICATE_CONTENT_DENOMINATOR), numf2.format(((double) result.getTotalContentBytes()) / DUPLICATE_CONTENT_DENOMINATOR));
result.setResultText(text);
result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), result.getDuplicateContentSizeOfUniqueItems(), numf2.format(((double) result.getDuplicateContentBytes()) / DUPLICATE_CONTENT_DENOMINATOR), numf2.format(((double) result.getTotalContentBytes()) / DUPLICATE_CONTENT_DENOMINATOR), numf.format(result.getDuplicateContentBytes() * 100.0 / result.getTotalContentBytes())));
}
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAllFiles(exportAllFiles);
result.setExportAllPct(exportAllPct);
result.setStaticsUnitsMbytes(staticsUnitsMbytes);
return result;
}
use of com.att.aro.core.bestpractice.pojo.DuplicateContentResult in project VideoOptimzer by attdevsupport.
the class BpDetailItem method refresh.
@Override
public void refresh(AROTraceData model) {
List<AbstractBestPracticeResult> bpResults = model.getBestPracticeResults();
for (AbstractBestPracticeResult bpr : bpResults) {
if (bpr.getBestPracticeType().equals(this.bpType)) {
resultsTextLabel.setText(bpr.getResultText());
imageLabel.setIcon(loadImageIcon(bpr));
if (bpr.getResultType().equals(BPResultType.CONFIG_REQUIRED)) {
addConfigIconActions();
} else {
imageLabel.setToolTipText("");
if (imageLabel.getMouseListeners() != null && imageLabel.getMouseListeners().length > 1) {
imageLabel.setCursor(Cursor.getDefaultCursor());
}
}
BestPracticeType resultType = bpr.getBestPracticeType();
switch(resultType) {
case FILE_COMPRESSION:
if (bpr.getResultType() == BPResultType.NONE)
((BpFileCompressionTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpFileCompressionTablePanel) resultsTablePanel).setData(((FileCompressionResult) bpr).getResults());
return;
case DUPLICATE_CONTENT:
if (bpr.getResultType() == BPResultType.NONE)
((BpFileDuplicateContentTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpFileDuplicateContentTablePanel) resultsTablePanel).setData(((DuplicateContentResult) bpr).getDuplicateContentList());
return;
case IMAGE_SIZE:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA)
((BpFileImageSizeTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpFileImageSizeTablePanel) resultsTablePanel).setData(((ImageSizeResult) bpr).getResults());
return;
case IMAGE_MDATA:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA)
((BpFileImageMDataTablePanel) imgMdataResultsTablePanel).setData(Collections.emptyList());
else
((BpFileImageMDataTablePanel) imgMdataResultsTablePanel).setData(((ImageMdtaResult) bpr).getResults());
return;
case IMAGE_CMPRS:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA)
((BpFileImageCompressionTablePanel) imageCompressionResultsTablePanel).setData(Collections.emptyList());
else
((BpFileImageCompressionTablePanel) imageCompressionResultsTablePanel).setData(((ImageCompressionResult) bpr).getResults());
return;
case IMAGE_FORMAT:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA)
((BpFileImageFormatTablePanel) imageFormatResultsTablePanel).setData(Collections.emptyList());
else
((BpFileImageFormatTablePanel) imageFormatResultsTablePanel).setData(((ImageFormatResult) bpr).getResults());
return;
case IMAGE_COMPARE:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA) {
((BpFileImageComparisionTablePanel) imageComparisonResultsTablePanel).setData(Collections.emptyList());
} else {
((BpFileImageComparisionTablePanel) imageComparisonResultsTablePanel).setData(((ImageComparatorResult) bpr).getResults());
}
return;
case MINIFICATION:
if (bpr.getResultType() == BPResultType.NONE)
((BpFileMinificationTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpFileMinificationTablePanel) resultsTablePanel).setData(((MinificationResult) bpr).getMinificationEntryList());
return;
case SPRITEIMAGE:
if (bpr.getResultType() == BPResultType.NONE)
((BpFileSpriteImagesTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpFileSpriteImagesTablePanel) resultsTablePanel).setData(((SpriteImageResult) bpr).getAnalysisResults());
return;
case HTTP_4XX_5XX:
if (bpr.getResultType() == BPResultType.NONE)
((BpConnectionsHttp4xx5xxTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpConnectionsHttp4xx5xxTablePanel) resultsTablePanel).setData(((Http4xx5xxResult) bpr).getHttpResCodelist());
return;
case HTTP_3XX_CODE:
if (bpr.getResultType() == BPResultType.NONE)
((BpConnectionsHttp3xxTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpConnectionsHttp3xxTablePanel) resultsTablePanel).setData(((Http3xxCodeResult) bpr).getHttp3xxResCode());
return;
case ASYNC_CHECK:
if (bpr.getResultType() == BPResultType.NONE)
((BpHtmlAsyncLoadTablePanel) resultsTablePanel).setData(Collections.emptyList());
else {
List<AsyncCheckEntry> res = ((AsyncCheckInScriptResult) bpr).getResults();
((BpHtmlAsyncLoadTablePanel) resultsTablePanel).setData(res);
}
return;
case FILE_ORDER:
if (bpr.getResultType() == BPResultType.NONE)
((BpHtmlFileOrderTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpHtmlFileOrderTablePanel) resultsTablePanel).setData(((FileOrderResult) bpr).getResults());
return;
case DISPLAY_NONE_IN_CSS:
if (bpr.getResultType() == BPResultType.NONE)
((BpHtmlDisplayNoneInCSSTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpHtmlDisplayNoneInCSSTablePanel) resultsTablePanel).setData(((DisplayNoneInCSSResult) bpr).getResults());
return;
case UNNECESSARY_CONNECTIONS:
if (bpr.getResultType() == BPResultType.NONE)
((BpConnectionsUnnecessaryTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpConnectionsUnnecessaryTablePanel) resultsTablePanel).setData(((UnnecessaryConnectionResult) bpr).getTightlyCoupledBurstsDetails());
return;
case HTTPS_USAGE:
if (bpr.getResultType() == BPResultType.NONE)
((BpSecurityHttpsUsageTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpSecurityHttpsUsageTablePanel) resultsTablePanel).setData(((HttpsUsageResult) bpr).getResults());
return;
case TRANSMISSION_PRIVATE_DATA:
if (bpr.getResultType() == BPResultType.NONE) {
((BpSecurityTransmissionPrivateDataTablePanel) resultsTablePanel).setData(Collections.emptyList());
buttonPrivateData.setEnabled(false);
} else {
((BpSecurityTransmissionPrivateDataTablePanel) resultsTablePanel).setData(((TransmissionPrivateDataResult) bpr).getResults());
buttonPrivateData.setEnabled(true);
}
return;
case UNSECURE_SSL_VERSION:
if (bpr.getResultType() == BPResultType.NONE)
((BpSecurityUnsecureSSLVersionTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpSecurityUnsecureSSLVersionTablePanel) resultsTablePanel).setData(((UnsecureSSLVersionResult) bpr).getResults());
return;
case FORWARD_SECRECY:
if (bpr.getResultType() == BPResultType.NONE)
((BpSecurityForwardSecrecyTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BpSecurityForwardSecrecyTablePanel) resultsTablePanel).setData(((ForwardSecrecyResult) bpr).getResults());
return;
case SIMUL_CONN:
if (bpr.getResultType() == BPResultType.NONE)
((BPConnectionsSimultnsTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BPConnectionsSimultnsTablePanel) resultsTablePanel).setData(((SimultnsConnectionResult) bpr).getResults());
return;
case MULTI_SIMULCONN:
if (bpr.getResultType() == BPResultType.NONE)
((BPConnectionsSimultnsTablePanel) resultsTablePanel).setData(Collections.emptyList());
else
((BPConnectionsSimultnsTablePanel) resultsTablePanel).setData(((MultiSimultnsConnectionResult) bpr).getResults());
return;
case VIDEO_STALL:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA) {
((BPVideoStallTablePanel) resultsTablePanel).setData(Collections.emptyList());
} else {
((BPVideoStallTablePanel) resultsTablePanel).setData(((VideoStallResult) bpr).getResults());
}
return;
case STARTUP_DELAY:
StartupDelayComparisonPanel startupDelayPanel = (StartupDelayComparisonPanel) resultsChartPanel;
List<VideoStartup> results = Collections.emptyList();
if (bpr.getResultType() != BPResultType.NONE) {
results = ((VideoStartUpDelayResult) bpr).getResults();
}
startupDelayPanel.setData(results);
return;
case VIDEO_ABR_LADDER:
VideoAdaptiveBitrateLadderPanel adaptiveBitrateLadderPanel = (VideoAdaptiveBitrateLadderPanel) resultsChartPanel;
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA) {
adaptiveBitrateLadderPanel.setData(Collections.emptyList());
((BPAdaptiveBitrateTablePanel) resultsTablePanel).setData(Collections.emptyList());
} else {
adaptiveBitrateLadderPanel.setData(((VideoAdaptiveBitrateLadderResult) bpr).getResults());
((BPAdaptiveBitrateTablePanel) resultsTablePanel).setData(((VideoAdaptiveBitrateLadderResult) bpr).getResults());
}
return;
case VIDEO_CONCURRENT_SESSION:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA) {
((BPVideoConcurrentSessionTablePanel) resultsTablePanel).setData(Collections.emptyList());
} else {
((BPVideoConcurrentSessionTablePanel) resultsTablePanel).setData(((VideoConcurrentSessionResult) bpr).getResults());
}
return;
case NETWORK_COMPARISON:
if (bpr.getResultType() == BPResultType.NONE || bpr.getResultType() == BPResultType.NO_DATA) {
((BPNetworkComparisonTablePanel) resultsTablePanel).setData(Collections.emptyList());
} else {
((BPNetworkComparisonTablePanel) resultsTablePanel).setData(((VideoNetworkComparisonResult) bpr).getResults());
}
return;
default:
return;
}
}
}
}
use of com.att.aro.core.bestpractice.pojo.DuplicateContentResult in project VideoOptimzer by attdevsupport.
the class ApplicationScoreDerived method processDerivedAttributes.
private void processDerivedAttributes(AROTraceData model, ApplicationSampling applicationSampling) {
int topScore = 100;
PacketAnalyzerResult analyzerResults = model.getAnalyzerResult();
List<AbstractBestPracticeResult> bpResults = model.getBestPracticeResults();
List<BurstAnalysisInfo> burstInfo = analyzerResults.getBurstCollectionAnalysisData().getBurstAnalysisInfo();
AbstractRrcStateMachine rrcStateMachine = analyzerResults.getStatemachine();
Statistic statistics = analyzerResults.getStatistic();
int burstInfoSize = burstInfo.size();
// TODO: CONNECTION_CLOSING and USING_CACHE enum types are reversed in model. FIX!
for (AbstractBestPracticeResult result : bpResults) {
if (result instanceof UsingCacheResult) {
UsingCacheResult bpuscaResult = (UsingCacheResult) result;
bpuscaResult.getCacheHeaderRatio();
cacheHeaderControlScore = (int) ((isUsingCache(bpuscaResult) ? topScore : getIndividualScore(bpuscaResult.getCacheHeaderRatio(), 10, 25, 65)) * .75);
} else if (result instanceof ConnectionClosingResult) {
ConnectionClosingResult bpcoclResult = (ConnectionClosingResult) result;
connectionClosingScore = (int) ((bpcoclResult.isConClosingProb() ? topScore : getIndividualScore(bpcoclResult.getTcpControlEnergyRatio() * 100, 5, 20, 50)) * .75);
} else if (result instanceof UnnecessaryConnectionResult) {
UnnecessaryConnectionResult bpunco = (UnnecessaryConnectionResult) result;
bpunco.getTightlyCoupledBurstCount();
int tightlyGroupedBursts = (int) (burstInfoSize > 0 ? 100.0 * bpunco.getTightlyCoupledBurstCount() / burstInfoSize : 0.0);
tightlyGroupedConnectionScore = (int) (tightlyGroupedBursts * 1.50);
} else if (result instanceof PeriodicTransferResult) {
PeriodicTransferResult periodicTransferResult = (PeriodicTransferResult) result;
periodicTransferScore = (int) ((isPeriodicCount(periodicTransferResult) ? topScore : getPeriodicTransferScoreCalculation(periodicTransferResult, burstInfo)) * 1.50);
} else if (result instanceof CacheControlResult) {
CacheControlResult cacheControlResultResult = (CacheControlResult) result;
connectionExpirationScore = (int) ((isCacheControl(cacheControlResultResult) ? topScore : getConnectionExpirationScoreCalculation(cacheControlResultResult)) * .50);
} else if (result instanceof DuplicateContentResult) {
DuplicateContentResult duplicateContentResult = (DuplicateContentResult) result;
duplicateContentScore = (int) ((isDuplicateContent(duplicateContentResult) ? topScore : getDuplicateContentScoreCalculation(duplicateContentResult)) * 1.25);
}
}
double promotionRatio;
double joulesPerKilobyte;
switch(rrcStateMachine.getType()) {
case LTE:
promotionRatio = ((RrcStateMachineLTE) rrcStateMachine).getCRPromotionRatio();
joulesPerKilobyte = ((RrcStateMachineLTE) rrcStateMachine).getJoulesPerKilobyte();
break;
case Type3G:
promotionRatio = ((RrcStateMachine3G) rrcStateMachine).getPromotionRatio();
joulesPerKilobyte = ((RrcStateMachine3G) rrcStateMachine).getJoulesPerKilobyte();
break;
case WiFi:
promotionRatio = 0.0;
joulesPerKilobyte = 0.0;
break;
default:
throw new AROUIPanelException("Undhandled state machine type " + rrcStateMachine.getType().name());
}
signalingOverheadScore = (int) (applicationSampling.getPromoRatioPercentile(promotionRatio) * 1.25);
averageRateScore = (int) (applicationSampling.getThroughputPercentile(statistics.getAverageKbps()) * .625);
energyEfficiencyScore = (int) (ApplicationSampling.getInstance().getJpkbPercentile(joulesPerKilobyte) * 1.875);
}
Aggregations