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;
}
Aggregations