Search in sources :

Example 1 with ConnectionStatisticsInfo

use of com.att.aro.ui.model.overview.ConnectionStatisticsInfo 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)

Aggregations

AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)1 UnnecessaryConnectionResult (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult)1 Burst (com.att.aro.core.packetanalysis.pojo.Burst)1 BurstCategory (com.att.aro.core.packetanalysis.pojo.BurstCategory)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 Termination (com.att.aro.core.packetanalysis.pojo.Termination)1 ConnectionStatisticsInfo (com.att.aro.ui.model.overview.ConnectionStatisticsInfo)1