Search in sources :

Example 1 with BurstAnalysisInfo

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;
}
Also used : ArrayList(java.util.ArrayList) BurstCategory(com.att.aro.core.packetanalysis.pojo.BurstCategory) BurstAnalysisInfo(com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo) Burst(com.att.aro.core.packetanalysis.pojo.Burst) EnumMap(java.util.EnumMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) EnumMap(java.util.EnumMap)

Example 2 with 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;
}
Also used : BurstAnalysisInfo(com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu)

Example 3 with BurstAnalysisInfo

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);
}
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 4 with BurstAnalysisInfo

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;
}
Also used : BurstAnalysisInfo(com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo) Burst(com.att.aro.core.packetanalysis.pojo.Burst) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) BurstCollectionAnalysisData(com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)

Aggregations

BurstAnalysisInfo (com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo)4 Burst (com.att.aro.core.packetanalysis.pojo.Burst)2 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)1 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)1 ConnectionClosingResult (com.att.aro.core.bestpractice.pojo.ConnectionClosingResult)1 DuplicateContentResult (com.att.aro.core.bestpractice.pojo.DuplicateContentResult)1 PeriodicTransferResult (com.att.aro.core.bestpractice.pojo.PeriodicTransferResult)1 UnnecessaryConnectionResult (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult)1 UsingCacheResult (com.att.aro.core.bestpractice.pojo.UsingCacheResult)1 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)1 BurstCategory (com.att.aro.core.packetanalysis.pojo.BurstCategory)1 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)1 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)1 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)1 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)1 AROUIPanelException (com.att.aro.ui.exception.AROUIPanelException)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1 ArrayList (java.util.ArrayList)1 EnumMap (java.util.EnumMap)1 LinkedHashMap (java.util.LinkedHashMap)1