Search in sources :

Example 1 with UnnecessaryConnectionResult

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

the class ARODiagnosticsOverviewRouteImpl method routeHyperlink.

@Override
public void routeHyperlink(BestPracticeType bpType) {
    if (bpType.equals(BestPracticeType.DUPLICATE_CONTENT)) {
        jtabbedPane.setSelectedIndex(OVERVIEW_INDEX);
    } else {
        jtabbedPane.setSelectedIndex(DIAGNOSTIC_INDEX);
        DiagnosticsTab diagnosticsTab = (DiagnosticsTab) jtabbedPane.getSelectedComponent();
        switch(bpType) {
            case FILE_COMPRESSION:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof FileCompressionResult) {
                // diagnosticsTab.setHighlightedTCP(((FileCompressionResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            // break;
            case USING_CACHE:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof UsingCacheResult) {
                            diagnosticsTab.setHighlightedTCP(((UsingCacheResult) result).getNoCacheHeaderFirstPacket().getTimeStamp());
                            break;
                        }
                    }
                }
                break;
            case CACHE_CONTROL:
                {
                // cant not find cache control start time in
                // CacheControlResult
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof CacheControlResult) {
                // diagnosticsTab.setHighlightedTCP(((CacheControlResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case COMBINE_CS_JSS:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof CombineCsJssResult) {
                            diagnosticsTab.setHighlightedTCP(((CombineCsJssResult) result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                            break;
                        }
                    }
                }
                break;
            case IMAGE_SIZE:
                {
                }
                break;
            case IMAGE_MDATA:
                {
                }
                break;
            case IMAGE_CMPRS:
                {
                }
                break;
            case IMAGE_FORMAT:
                {
                }
                break;
            case IMAGE_COMPARE:
                {
                }
                break;
            case MINIFICATION:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof CombineCsJssResult) {
                // diagnosticsTab.setHighlightedTCP(((MinificationResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case SPRITEIMAGE:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof SpriteImageResult) {
                // diagnosticsTab.setHighlightedTCP(((SpriteImageResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case UNNECESSARY_CONNECTIONS:
                {
                    // to test
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof UnnecessaryConnectionResult) {
                            diagnosticsTab.setHighlightedTCP(((UnnecessaryConnectionResult) result).getTightlyCoupledBurstTime());
                            break;
                        }
                    }
                }
                break;
            case SCRIPTS_URL:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof ScriptsResult) {
                            diagnosticsTab.setHighlightedTCP(((ScriptsResult) result).getFirstFailedHtml());
                            break;
                        }
                    }
                }
                break;
            case SCREEN_ROTATION:
                {
                }
                break;
            case SIMUL_CONN:
                {
                }
                break;
            case MULTI_SIMULCONN:
                {
                }
                break;
            case PERIODIC_TRANSFER:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof PeriodicTransferResult) {
                            diagnosticsTab.setHighlightedTCP(((PeriodicTransferResult) result).getMinimumPeriodicRepeatTime());
                            break;
                        }
                    }
                }
                break;
            case HTTP_4XX_5XX:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof Http4xx5xxResult) {
                // diagnosticsTab.setHighlightedTCP(((Http4xx5xxResult)result).getHttpResCodelist()ConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case HTTP_3XX_CODE:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof Http3xxCodeResult) {
                // diagnosticsTab.setHighlightedTCP(((Http3xxCodeResult)result).getFirstResMap()ConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case HTTP_1_0_USAGE:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof Http10UsageResult) {
                            diagnosticsTab.setHighlightedTCP(((Http10UsageResult) result).getHttp10Session());
                            break;
                        }
                    }
                }
                break;
            case FILE_ORDER:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof FileOrderResult) {
                // diagnosticsTab.setHighlightedTCP(((FileOrderResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case EMPTY_URL:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof EmptyUrlResult) {
                            diagnosticsTab.setHighlightedTCP(((EmptyUrlResult) result).getFirstFailedHtml());
                            break;
                        }
                    }
                }
                break;
            case DISPLAY_NONE_IN_CSS:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof DisplayNoneInCSSResult) {
                // diagnosticsTab.setHighlightedTCP(((DisplayNoneInCSSResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case CONNECTION_OPENING:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof ConnectionOpeningResult) {
                // diagnosticsTab.setHighlightedTCP(((ConnectionOpeningResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case CONNECTION_CLOSING:
                {
                    // done
                    for (AbstractBestPracticeResult result : diagnosticsTab.getAnalyzerResult().getBestPracticeResults()) {
                        if (result instanceof ConnectionClosingResult) {
                            diagnosticsTab.setHighlightedTCP(((ConnectionClosingResult) result).getLargestEnergyTime());
                            break;
                        }
                    }
                }
                break;
            case ASYNC_CHECK:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof AsyncCheckInScriptResult) {
                // diagnosticsTab.setHighlightedTCP(((AsyncCheckInScriptResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            case ACCESSING_PERIPHERALS:
                {
                // for (AbstractBestPracticeResult result :
                // diagnosticsTab.getAnalyzerResult().getBestPracticeResults())
                // {
                // if (result instanceof AccessingPeripheralResult) {
                // diagnosticsTab.setHighlightedTCP(((AccessingPeripheralResult)result).getConsecutiveCssJsFirstPacket().getTimeStamp());
                // break;
                // }
                // }
                }
                break;
            default:
                break;
        }
    // switch
    }
}
Also used : UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) ConnectionClosingResult(com.att.aro.core.bestpractice.pojo.ConnectionClosingResult) Http10UsageResult(com.att.aro.core.bestpractice.pojo.Http10UsageResult) PeriodicTransferResult(com.att.aro.core.bestpractice.pojo.PeriodicTransferResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) ScriptsResult(com.att.aro.core.bestpractice.pojo.ScriptsResult) CombineCsJssResult(com.att.aro.core.bestpractice.pojo.CombineCsJssResult) DiagnosticsTab(com.att.aro.ui.view.diagnostictab.DiagnosticsTab) EmptyUrlResult(com.att.aro.core.bestpractice.pojo.EmptyUrlResult) UsingCacheResult(com.att.aro.core.bestpractice.pojo.UsingCacheResult)

Example 2 with UnnecessaryConnectionResult

use of com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult 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;
            }
        }
    }
}
Also used : AsyncCheckEntry(com.att.aro.core.bestpractice.pojo.AsyncCheckEntry) UnsecureSSLVersionResult(com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionResult) ImageFormatResult(com.att.aro.core.bestpractice.pojo.ImageFormatResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) BestPracticeType(com.att.aro.core.bestpractice.pojo.BestPracticeType) ImageSizeResult(com.att.aro.core.bestpractice.pojo.ImageSizeResult) DisplayNoneInCSSResult(com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSResult) UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) MultiSimultnsConnectionResult(com.att.aro.core.bestpractice.pojo.MultiSimultnsConnectionResult) SimultnsConnectionResult(com.att.aro.core.bestpractice.pojo.SimultnsConnectionResult) VideoStartup(com.att.aro.core.videoanalysis.pojo.VideoStartup) Http3xxCodeResult(com.att.aro.core.bestpractice.pojo.Http3xxCodeResult) HttpsUsageResult(com.att.aro.core.bestpractice.pojo.HttpsUsageResult) MinificationResult(com.att.aro.core.bestpractice.pojo.MinificationResult) SpriteImageResult(com.att.aro.core.bestpractice.pojo.SpriteImageResult) ForwardSecrecyResult(com.att.aro.core.bestpractice.pojo.ForwardSecrecyResult) FileOrderResult(com.att.aro.core.bestpractice.pojo.FileOrderResult) AsyncCheckInScriptResult(com.att.aro.core.bestpractice.pojo.AsyncCheckInScriptResult) FileCompressionResult(com.att.aro.core.bestpractice.pojo.FileCompressionResult) DuplicateContentResult(com.att.aro.core.bestpractice.pojo.DuplicateContentResult) Http4xx5xxResult(com.att.aro.core.bestpractice.pojo.Http4xx5xxResult) MultiSimultnsConnectionResult(com.att.aro.core.bestpractice.pojo.MultiSimultnsConnectionResult) ImageCompressionResult(com.att.aro.core.bestpractice.pojo.ImageCompressionResult) ImageMdtaResult(com.att.aro.core.bestpractice.pojo.ImageMdtaResult)

Example 3 with UnnecessaryConnectionResult

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

the class ConnectionStatisticsChartPanel method generateDataForChart.

private ConnectionStatisticsInfo generateDataForChart() {
    ConnectionStatisticsInfo connectionStatisticsPojo = new ConnectionStatisticsInfo();
    double sessionTermPct = 0.0;
    int longBurstCount = 0;
    if (traceDataModel != null && traceDataModel.getAnalyzerResult() != null) {
        int termSessions = 0;
        int properTermSessions = 0;
        for (Session tcpSession : traceDataModel.getAnalyzerResult().getSessionlist()) {
            if (!tcpSession.isUdpOnly()) {
                Termination termination = tcpSession.getSessionTermination();
                if (termination != null) {
                    ++termSessions;
                    if (termination.getSessionTerminationDelay() <= SESSION_TERMINATION_THRESHOLD) {
                        ++properTermSessions;
                    }
                }
            }
        }
        if (termSessions > 0) {
            sessionTermPct = 100.0 * properTermSessions / termSessions;
        }
        longBurstCount = traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getLongBurstCount();
    }
    connectionStatisticsPojo.setSessionTermPct(sessionTermPct);
    double tightlyCoupledTCPPct = 0.0;
    if (traceDataModel != null && traceDataModel.getAnalyzerResult() != null) {
        int burstSize = traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getBurstCollection().size();
        int periodicBurstCount = 0;
        for (Burst burstInfo : traceDataModel.getAnalyzerResult().getBurstCollectionAnalysisData().getBurstCollection()) {
            BurstCategory bCategory = burstInfo.getBurstCategory();
            if (bCategory == BurstCategory.PERIODICAL) {
                periodicBurstCount += 1;
            }
        }
        double nonPeriodicBurstPct = 100 - 100.0 * periodicBurstCount / burstSize;
        connectionStatisticsPojo.setNonPeriodicBurstPct(nonPeriodicBurstPct);
        int tightlyCoupledBurstCount = 0;
        for (AbstractBestPracticeResult abstractResult : traceDataModel.getBestPracticeResults()) {
            if (abstractResult.getBestPracticeType().equals(BestPracticeType.UNNECESSARY_CONNECTIONS) && abstractResult.getResultType() != BPResultType.NONE) {
                UnnecessaryConnectionResult unnecessaryConnt = (UnnecessaryConnectionResult) abstractResult;
                tightlyCoupledBurstCount = unnecessaryConnt.getTightlyCoupledBurstCount();
            }
        }
        tightlyCoupledTCPPct = 100.0 * tightlyCoupledBurstCount / burstSize;
        connectionStatisticsPojo.setTightlyCoupledTCPPct(tightlyCoupledTCPPct);
        double longBurstPct = 0.0;
        longBurstPct = 100.0 * longBurstCount / burstSize;
        connectionStatisticsPojo.setLongBurstPct(longBurstPct);
    }
    return connectionStatisticsPojo;
}
Also used : UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) BurstCategory(com.att.aro.core.packetanalysis.pojo.BurstCategory) ConnectionStatisticsInfo(com.att.aro.ui.model.overview.ConnectionStatisticsInfo) Burst(com.att.aro.core.packetanalysis.pojo.Burst) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) Termination(com.att.aro.core.packetanalysis.pojo.Termination) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 4 with UnnecessaryConnectionResult

use of com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult 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);
}
Also used : PeriodicTransferResult(com.att.aro.core.bestpractice.pojo.PeriodicTransferResult) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) ConnectionClosingResult(com.att.aro.core.bestpractice.pojo.ConnectionClosingResult) DuplicateContentResult(com.att.aro.core.bestpractice.pojo.DuplicateContentResult) Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) BurstAnalysisInfo(com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo) AROUIPanelException(com.att.aro.ui.exception.AROUIPanelException) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) AbstractRrcStateMachine(com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine) CacheControlResult(com.att.aro.core.bestpractice.pojo.CacheControlResult) UsingCacheResult(com.att.aro.core.bestpractice.pojo.UsingCacheResult)

Example 5 with UnnecessaryConnectionResult

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

the class UnnecessaryConnectionImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    UnnecessaryConnectionResult result = new UnnecessaryConnectionResult();
    ucEntryList = new ArrayList<UnnecessaryConnectionEntry>();
    validateUnnecessaryConnections(tracedata.getBurstCollectionAnalysisData().getBurstCollection());
    if (tightlyCoupledBurstCount < 4) {
        result.setResultType(BPResultType.PASS);
        result.setResultText(textResultPass);
        result.setResultExcelText(BPResultType.PASS.getDescription());
    } else {
        result.setResultType(BPResultType.FAIL);
        String text = MessageFormat.format(this.textResults, this.tightlyCoupledBurstCount);
        result.setResultText(text);
        result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), tightlyCoupledBurstCount));
    }
    result.setTightlyCoupledBurstCount(tightlyCoupledBurstCount);
    result.setTightlyCoupledBurstTime(tightlyCoupledBurstTime);
    result.setTightlyCoupledBurstsDetails(ucEntryList);
    result.setSelfTest(false);
    result.setAboutText(aboutText);
    result.setDetailTitle(detailTitle);
    result.setLearnMoreUrl(learnMoreUrl);
    result.setOverviewTitle(overviewTitle);
    result.setExportAllMultiConnDesc(exportAllMultiConnDesc);
    return result;
}
Also used : UnnecessaryConnectionResult(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult) UnnecessaryConnectionEntry(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionEntry)

Aggregations

UnnecessaryConnectionResult (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult)5 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)4 ConnectionClosingResult (com.att.aro.core.bestpractice.pojo.ConnectionClosingResult)2 DuplicateContentResult (com.att.aro.core.bestpractice.pojo.DuplicateContentResult)2 PeriodicTransferResult (com.att.aro.core.bestpractice.pojo.PeriodicTransferResult)2 UsingCacheResult (com.att.aro.core.bestpractice.pojo.UsingCacheResult)2 AsyncCheckEntry (com.att.aro.core.bestpractice.pojo.AsyncCheckEntry)1 AsyncCheckInScriptResult (com.att.aro.core.bestpractice.pojo.AsyncCheckInScriptResult)1 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)1 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)1 CombineCsJssResult (com.att.aro.core.bestpractice.pojo.CombineCsJssResult)1 DisplayNoneInCSSResult (com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSResult)1 EmptyUrlResult (com.att.aro.core.bestpractice.pojo.EmptyUrlResult)1 FileCompressionResult (com.att.aro.core.bestpractice.pojo.FileCompressionResult)1 FileOrderResult (com.att.aro.core.bestpractice.pojo.FileOrderResult)1 ForwardSecrecyResult (com.att.aro.core.bestpractice.pojo.ForwardSecrecyResult)1 Http10UsageResult (com.att.aro.core.bestpractice.pojo.Http10UsageResult)1 Http3xxCodeResult (com.att.aro.core.bestpractice.pojo.Http3xxCodeResult)1 Http4xx5xxResult (com.att.aro.core.bestpractice.pojo.Http4xx5xxResult)1 HttpsUsageResult (com.att.aro.core.bestpractice.pojo.HttpsUsageResult)1