Search in sources :

Example 11 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class BestPracticeResultsListener method addTimeRangeAnalysisAndStatisticRows.

private void addTimeRangeAnalysisAndStatisticRows(List<List<Object>> dataRows) {
    if (traceData.getAnalyzerResult() != null) {
        TimeRangeAnalysis timeRangeAnalysis = traceData.getAnalyzerResult().getTimeRangeAnalysis();
        // Calculate time range
        if (timeRangeAnalysis == null) {
            AnalysisFilter filter = traceData.getAnalyzerResult().getFilter();
            double beginTime = 0.0d;
            double endTime = 0.0d;
            boolean readyForAnalysis = false;
            if (filter != null && filter.getTimeRange() != null) {
                beginTime = filter.getTimeRange().getBeginTime();
                endTime = filter.getTimeRange().getEndTime();
                readyForAnalysis = true;
            } else if (traceData.getAnalyzerResult().getTraceresult() != null) {
                endTime = traceData.getAnalyzerResult().getTraceresult().getTraceDuration();
                readyForAnalysis = true;
            }
            if (readyForAnalysis) {
                timeRangeAnalysis = new TimeRangeAnalysis(beginTime, endTime, traceData.getAnalyzerResult());
            }
        }
        if (timeRangeAnalysis != null) {
            double traceDuration = timeRangeAnalysis.getEndTime() - timeRangeAnalysis.getStartTime();
            long traceDurationLong = (long) traceDuration;
            dataRows.add(Arrays.asList(getFontStyledColumn("Duration (second)"), formatToFixedDecimal(3, traceDuration)));
            dataRows.add(Arrays.asList(getFontStyledColumn("Duration (hh:mm:ss.sss)"), String.format("%02d:%02d:%02d", traceDurationLong / 3600, (traceDurationLong % 3600) / 60, traceDurationLong % 60) + String.format("%.3f", traceDuration - Math.floor(traceDuration)).substring(1)));
            String timeRangeTitle = traceData.getAnalyzerResult().getTraceresult().getTimeRange().getTitle();
            dataRows.add(Arrays.asList(getFontStyledColumn("Time Range Identifier"), timeRangeTitle != null ? timeRangeTitle : ""));
            dataRows.add(Arrays.asList(getFontStyledColumn("Start Time (second)"), formatToFixedDecimal(3, timeRangeAnalysis.getStartTime())));
            dataRows.add(Arrays.asList(getFontStyledColumn("End Time (second)"), formatToFixedDecimal(3, timeRangeAnalysis.getEndTime())));
        }
        Statistic statistic = traceData.getAnalyzerResult().getStatistic();
        if (statistic != null) {
            dataRows.add(Arrays.asList(getFontStyledColumn("Total Data (KB)"), formatToFixedDecimal(2, statistic.getTotalByte() / 1000.0)));
            dataRows.add(Arrays.asList(getFontStyledColumn("Total Payload Data (KB)"), formatToFixedDecimal(2, statistic.getTotalPayloadBytes() / 1000.0)));
            dataRows.add(Arrays.asList(getFontStyledColumn("HTTPS Data (KB)"), formatToFixedDecimal(2, statistic.getTotalHTTPSByte() / 1000.0)));
            dataRows.add(Arrays.asList(getFontStyledColumn("Unanalyzed HTTPS Data (KB)"), formatToFixedDecimal(2, statistic.getTotalHTTPSBytesNotAnalyzed() / 1000.0)));
        }
        if (timeRangeAnalysis != null) {
            dataRows.add(Arrays.asList(getFontStyledColumn("Average Throughput (kbps)"), formatToFixedDecimal(2, timeRangeAnalysis.getAverageThroughput())));
            dataRows.add(Arrays.asList(getFontStyledColumn("Total Upload Data (KB)"), formatToFixedDecimal(2, timeRangeAnalysis.getUplinkBytes() / 1000.0)));
            dataRows.add(Arrays.asList(getFontStyledColumn("Average Upload Throughput (kbps)"), formatToFixedDecimal(2, timeRangeAnalysis.getAverageUplinkThroughput())));
            dataRows.add(Arrays.asList(getFontStyledColumn("Total Download Data (KB)"), formatToFixedDecimal(2, timeRangeAnalysis.getDownlinkBytes() / 1000.0)));
            dataRows.add(Arrays.asList(getFontStyledColumn("Average Download Throughput (kbps)"), formatToFixedDecimal(2, timeRangeAnalysis.getAverageDownlinkThroughput())));
        }
        if (statistic != null) {
            dataRows.add(Arrays.asList(getFontStyledColumn("Total Energy Consumed (J)"), formatToFixedDecimal(2, traceData.getAnalyzerResult().getEnergyModel().getTotalEnergyConsumed())));
        }
    }
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) TimeRangeAnalysis(com.att.aro.core.packetanalysis.impl.TimeRangeAnalysis)

Example 12 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HTTPCacheStatistics method refresh.

@Override
public void refresh(AROTraceData model) {
    PacketAnalyzerResult analyzerResult = model.getAnalyzerResult();
    CacheAnalysis cacheAnalysis = analyzerResult.getCacheAnalysis();
    Statistic statistic = analyzerResult.getStatistic();
    List<Session> sessions = analyzerResult.getSessionlist();
    if (cacheAnalysis != null && statistic != null && sessions != null) {
        CacheAnalysisDerived cacheAnalysisDerived = new CacheAnalysisDerived(cacheAnalysis, statistic, sessions);
        refreshLine(LabelKeys.cache_cacheable, cacheAnalysisDerived.getPctCacheableResponses(), cacheAnalysisDerived.getPctCacheableBytes());
        refreshLine(LabelKeys.cache_nonCachable, cacheAnalysisDerived.getPctNonCacheableResponses(), cacheAnalysisDerived.getPctNonCacheableBytes());
        refreshLine(LabelKeys.cache_cacheMiss, cacheAnalysisDerived.getPctCacheMissResponses(), cacheAnalysisDerived.getPctCacheMissBytes());
        refreshLine(LabelKeys.cache_notCacheable, cacheAnalysisDerived.getPctNotCacheableResponses(), cacheAnalysisDerived.getPctNotCacheableBytes());
        refreshLine(LabelKeys.cache_cacheHitExpiredDup304, cacheAnalysisDerived.getPctExpiredResponses(), cacheAnalysisDerived.getPctExpiredBytes());
        refreshLine(LabelKeys.cache_cacheHitRespChanged, cacheAnalysisDerived.getPctNotExpiredResponses(), cacheAnalysisDerived.getPctNotExpiredBytes());
        refreshLine(LabelKeys.cache_cacheHitNotExpiredDup, cacheAnalysisDerived.getPctCacheMissResponses(), cacheAnalysisDerived.getPctCacheMissBytes());
        refreshLine(LabelKeys.cache_cacheHitExpiredClientDup, cacheAnalysisDerived.getPctNotCacheableResponses(), cacheAnalysisDerived.getPctNotCacheableBytes());
        refreshLine(LabelKeys.cache_cacheHitExpiredServerDup, cacheAnalysisDerived.getPctCacheHitNotExpiredDupResponses(), cacheAnalysisDerived.getPctCacheHitNotExpiredDupBytes());
        refreshLine(LabelKeys.cache_partialHitNotExpiredDup, cacheAnalysisDerived.getPctCacheHitRespChangedResponses(), cacheAnalysisDerived.getPctCacheHitRespChangedBytes());
        refreshLine(LabelKeys.cache_partialHitExpiredClientDup, cacheAnalysisDerived.getPctCacheHitExpiredDupClientResponses(), cacheAnalysisDerived.getPctCacheHitExpiredDupClientBytes());
        refreshLine(LabelKeys.cache_partialHitExpiredServerDup, cacheAnalysisDerived.getPctCacheHitExpiredDupServerResponses(), cacheAnalysisDerived.getPctCacheHitExpiredDupServerBytes());
        refreshLine(LabelKeys.cache_notExpired, cacheAnalysisDerived.getPctCacheHitDup304Responses(), cacheAnalysisDerived.getPctCacheHitDup304Bytes());
        refreshLine(LabelKeys.cache_notExpiredHeur, cacheAnalysisDerived.getPctPartialHitExpiredDupClientResponses(), cacheAnalysisDerived.getPctPartialHitExpiredDupClientBytes());
        refreshLine(LabelKeys.cache_expired, cacheAnalysisDerived.getPctPartialHitExpiredDupServerResponses(), cacheAnalysisDerived.getPctPartialHitExpiredDupServerBytes());
        refreshLine(LabelKeys.cache_expiredHeur, cacheAnalysisDerived.getPctPartialHitNotExpiredDupResponses(), cacheAnalysisDerived.getPctPartialHitNotExpiredDupBytes());
    }
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) CacheAnalysis(com.att.aro.core.packetanalysis.pojo.CacheAnalysis) CacheAnalysisDerived(com.att.aro.ui.view.statistics.model.CacheAnalysisDerived) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 13 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HtmlReportImplTest method reportGenerator_retunrIsTrue.

@Test
@Ignore
public void reportGenerator_retunrIsTrue() {
    AccessingPeripheralResult access = new AccessingPeripheralResult();
    access.setResultType(BPResultType.PASS);
    CacheControlResult cache = new CacheControlResult();
    cache.setResultType(BPResultType.FAIL);
    List<AbstractBestPracticeResult> bpResults = new ArrayList<AbstractBestPracticeResult>();
    bpResults.add(access);
    bpResults.add(cache);
    File tempFile = null;
    try {
        tempFile = folder.newFile("abc.html");
    } catch (IOException e) {
        e.printStackTrace();
    }
    if (tempFile != null) {
        tempFile.deleteOnExit();
    }
    when(filereader.createFile(any(String.class))).thenReturn(tempFile);
    AROTraceData results = new AROTraceData();
    PacketAnalyzerResult analyzerResult = new PacketAnalyzerResult();
    TraceDirectoryResult tracedirresult = new TraceDirectoryResult();
    EnergyModel energyModel = new EnergyModel();
    Statistic statistic = new Statistic();
    statistic.setTotalByte(123);
    statistic.setTotalHTTPSByte(123);
    tracedirresult.setTraceDirectory("temp.txt");
    analyzerResult.setTraceresult(tracedirresult);
    analyzerResult.setEnergyModel(energyModel);
    analyzerResult.setStatistic(statistic);
    results.setAnalyzerResult(analyzerResult);
    results.setBestPracticeResults(bpResults);
    assertTrue(htmlReportImpl.reportGenerator("abc.html", results));
}
Also used : EnergyModel(com.att.aro.core.packetanalysis.pojo.EnergyModel) AbstractBestPracticeResult(com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult) ArrayList(java.util.ArrayList) IOException(java.io.IOException) AROTraceData(com.att.aro.core.pojo.AROTraceData) AccessingPeripheralResult(com.att.aro.core.bestpractice.pojo.AccessingPeripheralResult) Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) CacheControlResult(com.att.aro.core.bestpractice.pojo.CacheControlResult) File(java.io.File) Ignore(org.junit.Ignore) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 14 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic 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 15 with Statistic

use of com.att.aro.core.packetanalysis.pojo.Statistic in project VideoOptimzer by attdevsupport.

the class HttpsUsageImplTest method testNullDomainName.

@Test
public void testNullDomainName() {
    String domainNameUnderTest = null;
    pktAnalyzerResult = domainNameTestSetup("157.56.19.80", "216.58.194.196", "157.56.19.80", "www.gstatic.com", domainNameUnderTest);
    Statistic statistic = new Statistic();
    statistic.setTotalByte(123);
    statistic.setTotalHTTPSByte(123);
    statistic.setTotalHTTPSBytesNotAnalyzed(123);
    pktAnalyzerResult.setStatistic(statistic);
    httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult);
    httpsUsageEntries = httpsUsageResult.getResults();
    domainNameTestVerification(httpsUsageEntries, "");
}
Also used : Statistic(com.att.aro.core.packetanalysis.pojo.Statistic) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)22 BaseTest (com.att.aro.core.BaseTest)11 ArrayList (java.util.ArrayList)11 Test (org.junit.Test)11 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)9 Session (com.att.aro.core.packetanalysis.pojo.Session)9 InetAddress (java.net.InetAddress)8 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)4 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)3 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)3 EnergyModel (com.att.aro.core.packetanalysis.pojo.EnergyModel)3 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)2 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)2 TimeRangeAnalysis (com.att.aro.core.packetanalysis.impl.TimeRangeAnalysis)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)2 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)2 AROTraceData (com.att.aro.core.pojo.AROTraceData)2 File (java.io.File)2