use of com.att.aro.ui.exception.AROUIPanelException in project VideoOptimzer by attdevsupport.
the class TabPanelCommon method setText.
public void setText(Enum<?> enumParm, String value, MouseAdapter mouseAdapter) {
if (enumParm == null) {
throw new AROUIPanelException("enumParm must be specified");
}
String key = getKeyFromEnum(enumParm);
StringBuilder text = new StringBuilder();
text.append("<html><a href=\"#\">");
text.append(value);
text.append("</a></html>");
setText(key, 1, text.toString());
JLabel infoLabel = labelContents.get(key);
infoLabel.addMouseListener(mouseAdapter);
infoLabel.setToolTipText(ResourceBundleHelper.getMessageString("trace.hyperlink"));
infoLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
}
use of com.att.aro.ui.exception.AROUIPanelException 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);
}
use of com.att.aro.ui.exception.AROUIPanelException in project VideoOptimzer by attdevsupport.
the class CacheAnalysisDerived method getResponseBytesCounts.
/**
* This gets all the counts we need in a single pass through the diagnostic results
*
* @param diagnosticResults
* @param diagnosis The list of diagnostic count buckets that are part of the return map
* @return A map of the counts associated with a diagnosis attributes in diagnosis
*/
private Map<Diagnosis, DiagnosisCounts> getResponseBytesCounts(List<CacheEntry> diagnosticResults, Diagnosis[] diagnosis) {
Map<Diagnosis, DiagnosisCounts> diagnosisPercentsMap = new HashMap<Diagnosis, DiagnosisCounts>();
DiagnosisCounts totalBucket = new DiagnosisCounts();
diagnosisPercentsMap.put(repurposedTotalBucket, totalBucket);
// Create the count buckets for matched and unmatched attributes
Set<Diagnosis> duplicateCheck = new HashSet<Diagnosis>();
for (Diagnosis currentDiagnosis : diagnosis) {
if (duplicateCheck.contains(currentDiagnosis)) {
throw new AROUIPanelException("Cannot have duplicate diagnosis (" + currentDiagnosis.name() + ")");
}
diagnosisPercentsMap.put(currentDiagnosis, new DiagnosisCounts());
duplicateCheck.add(currentDiagnosis);
}
duplicateCheck.clear();
duplicateCheck = null;
// Now go through the diagnosis results, updating counts as necessary
for (CacheEntry diagnosticResult : diagnosticResults) {
Diagnosis currentResultDiagnosis = diagnosticResult.getDiagnosis();
// Only look if basic validity passed
if (isValidResult(currentResultDiagnosis)) {
for (Diagnosis currentDiagnosis : diagnosis) {
if (currentResultDiagnosis == currentDiagnosis) {
diagnosisPercentsMap.get(currentDiagnosis).incrementMatchedResponsesBytes(diagnosticResult);
} else {
diagnosisPercentsMap.get(currentDiagnosis).incrementUnmatchedResponsesBytes(diagnosticResult);
}
}
totalBucket.incrementMatchedResponsesBytes(diagnosticResult);
}
}
return diagnosisPercentsMap;
}
use of com.att.aro.ui.exception.AROUIPanelException in project VideoOptimzer by attdevsupport.
the class StatisticsTab method refresh.
public void refresh(AROTraceData model) {
// Energy Efficiency Simulation & Rrc State Machine Simulation
PacketAnalyzerResult analyzerResult = model.getAnalyzerResult();
if (rrcStateMachineType != analyzerResult.getStatemachine().getType()) {
rrcStateMachineType = analyzerResult.getStatemachine().getType();
layoutRrcStateMachineSimulator(rrcStateMachineType);
layoutEnergyEffecencySimulation(rrcStateMachineType);
}
dateTraceAppDetailPanel.refresh(model);
tcpSessionStatistics.refresh(model);
if (model.getAnalyzerResult().getTraceresult().getTraceResultType().equals(TraceResultType.TRACE_DIRECTORY)) {
TraceDirectoryResult traceResult = (TraceDirectoryResult) model.getAnalyzerResult().getTraceresult();
CollectOptions collectOptions = traceResult.getCollectOptions();
if (collectOptions != null) {
layoutAttenuation(model);
}
} else {
if (attenuationConstantPanel != null) {
attenuationConstantPanel.resetPanelData();
}
if (attenuationProfilePanel != null) {
attenuationProfilePanel.resetPanelData();
}
}
endPointSummaryPanel.refresh(model);
burstAnalysisPanel.refresh(model);
httpCacheStatistics.refresh(model);
switch(rrcStateMachineType) {
case Type3G:
rrcStateMachineSimulationPanel3G.refresh(model);
energyModelStatistics3GPanel.refresh(model);
break;
case LTE:
rrcStateMachineSimulationPanelLTE.refresh(model);
energyModelStatisticsLTEPanel.refresh(model);
break;
case WiFi:
rrcStateMachineSimulationPanelWiFi.refresh(model);
energyModelStatisticsWiFiPanel.refresh(model);
break;
default:
throw new AROUIPanelException("Unhandled handling for rrc type " + rrcStateMachineType.name());
}
this.model = model;
exportBtn.setEnabled(model != null);
}
use of com.att.aro.ui.exception.AROUIPanelException in project VideoOptimzer by attdevsupport.
the class EnergyEfficiencySimulationLTE method getRrcStateMachineValue.
private String[] getRrcStateMachineValue(PacketAnalyzerResult analyzerResult, LabelKeys labelKey, String[] valueString) {
RrcStateMachineLTE rrcStateMachine = (RrcStateMachineLTE) analyzerResult.getStatemachine();
Double originalValue = null;
valueString[0] = "";
switch(analyzerResult.getStatemachine().getType()) {
case LTE:
switch(labelKey) {
case rrc_continuousReceptionIdle:
originalValue = rrcStateMachine.getLteIdleToCRPromotionEnergy();
break;
case energy_shortDRX:
originalValue = rrcStateMachine.getLteDrxShortTime();
break;
case energy_continuousReception:
originalValue = rrcStateMachine.getLteCrTime();
break;
case energy_idle:
originalValue = rrcStateMachine.getLteIdleEnergy();
break;
case energy_promotionRatio:
originalValue = rrcStateMachine.getLteIdleToCRPromotionEnergy();
break;
case energy_continuousReceptionEnergy:
originalValue = rrcStateMachine.getLteCrEnergy();
break;
case energy_continuousReceptionTail:
originalValue = rrcStateMachine.getLteCrTailEnergy();
break;
case energy_promotionRatioTime:
originalValue = rrcStateMachine.getLteIdleToCRPromotionTime();
break;
case energy_shortDRXEnergy:
originalValue = rrcStateMachine.getLteDrxShortEnergy();
break;
case energy_rrcTotal:
originalValue = rrcStateMachine.getTotalRRCEnergy();
break;
case energy_jpkb:
originalValue = rrcStateMachine.getJoulesPerKilobyte();
break;
default:
throw new AROUIPanelException("Key " + analyzerResult.getStatemachine().getType().name() + " not handled yet");
}
break;
default:
throw new AROUIPanelException("Bad rrc state machine machine type " + analyzerResult.getStatemachine().getType() + " for expected type of LTE");
}
if (originalValue != null) {
valueString[0] = String.format("%1.2f", originalValue);
}
return valueString;
}
Aggregations