use of com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo in project VideoOptimzer by attdevsupport.
the class BurstCollectionAnalysisImpl method analyzeBurstStat.
/**
* Method to assign the states for all the bursts.
*
* @param analyzeBeginTime
* @param analyseEndTime
* @return
*/
private List<BurstAnalysisInfo> analyzeBurstStat(List<Burst> burstCollection) {
Map<BurstCategory, Double> burstCategoryToEnergy = new EnumMap<BurstCategory, Double>(BurstCategory.class);
Map<BurstCategory, Long> burstCategoryToPayload = new EnumMap<BurstCategory, Long>(BurstCategory.class);
Map<BurstCategory, Double> burstCategoryToActive = new EnumMap<BurstCategory, Double>(BurstCategory.class);
List<BurstAnalysisInfo> burstAnalysisInfo = new ArrayList<BurstAnalysisInfo>();
long totalPayload = 0;
double totalAct = 0.0;
double totalEnergy = 0.0;
for (Burst aBurst : burstCollection) {
BurstCategory category = aBurst.getBurstCategory();
double energy = aBurst.getEnergy();
totalEnergy += energy;
Double catEnergy = burstCategoryToEnergy.get(category);
double catEnergygValue = catEnergy != null ? catEnergy.doubleValue() : 0.0;
catEnergygValue += energy;
burstCategoryToEnergy.put(category, catEnergygValue);
int bPayLoadLength = getPayloadLength(aBurst, false);
totalPayload += bPayLoadLength;
Long payload = burstCategoryToPayload.get(category);
long payLoadValue = payload != null ? payload.longValue() : 0L;
payLoadValue += bPayLoadLength;
burstCategoryToPayload.put(category, payLoadValue);
double activeTime = aBurst.getActiveTime();
totalAct += activeTime;
Double catAct = burstCategoryToActive.get(category);
catEnergygValue = catAct != null ? catAct.doubleValue() : 0.0;
catEnergygValue += activeTime;
burstCategoryToActive.put(category, catEnergygValue);
}
for (Map.Entry<BurstCategory, Double> entry : burstCategoryToEnergy.entrySet()) {
BurstCategory categ = entry.getKey();
long catPayload = burstCategoryToPayload.get(categ);
double catEnergy = burstCategoryToEnergy.get(categ);
double catActive = burstCategoryToActive.get(categ);
Double jpkb = catPayload > 0 ? catEnergy / (catPayload * 8 / 1000.0f) : null;
burstAnalysisInfo.add(new BurstAnalysisInfo(categ, catPayload, totalPayload > 0 ? (((double) catPayload / totalPayload) * 100.0) : 0, catEnergy, totalEnergy > 0.0 ? ((catEnergy / totalEnergy) * 100.0) : 0.0, catActive, totalAct > 0.0 ? ((catActive / totalAct) * 100.0) : 0.0, jpkb));
}
return burstAnalysisInfo;
}
use of com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo in project VideoOptimzer by attdevsupport.
the class BurstAnalysisPanel method getTable.
/**
* Returns a DataTable containing the burst analysis data.
*
* @return A DataTable object containing the burst analysis data.
*/
public DataTable<BurstAnalysisInfo> getTable() {
if (table == null) {
table = new DataTable<BurstAnalysisInfo>(tableModel);
table.setName(ResourceBundleHelper.getMessageString("statistics.burst.analysis.tableName"));
table.setGridColor(Color.LIGHT_GRAY);
table.setAutoCreateRowSorter(true);
DataTablePopupMenu popupMenu = (DataTablePopupMenu) table.getPopup();
popupMenu.initialize();
}
return table;
}
use of com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo 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.core.packetanalysis.pojo.BurstAnalysisInfo in project VideoOptimzer by attdevsupport.
the class BurstCollectionAnalysisImpl method analyze.
@Override
public BurstCollectionAnalysisData analyze(List<PacketInfo> packets, Profile profile, Map<Integer, Integer> packetSizeToCountMap, List<RrcStateRange> rrcstaterangelist, List<UserEvent> usereventlist, List<CpuActivity> cpuactivitylist, List<Session> sessionlist) {
BurstCollectionAnalysisData data = new BurstCollectionAnalysisData();
Set<Integer> mss = calculateMssLargerPacketSizeSet(packetSizeToCountMap);
List<Burst> burstCollection = groupIntoBursts(packets, profile, mss, rrcstaterangelist);
data.setBurstCollection(burstCollection);
if (!burstCollection.isEmpty()) {
int longBurstCount = analyzeBursts(burstCollection, usereventlist, cpuactivitylist, profile);
data.setLongBurstCount(longBurstCount);
double totalEnergy = computeBurstEnergyRadioResource(rrcstaterangelist, burstCollection, profile);
data.setTotalEnergy(totalEnergy);
List<BurstAnalysisInfo> burstAnalysisInfo = analyzeBurstStat(burstCollection);
data.setBurstAnalysisInfo(burstAnalysisInfo);
PacketInfo shortestPacket = findShortestPeriodPacketInfo(burstCollection);
data.setShortestPeriodPacketInfo(shortestPacket);
}
return data;
}
Aggregations