Search in sources :

Example 16 with PacketAnalyzerResult

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

the class FilterApplicationsAndIpDialog method initialize.

/**
 * Initializes the dialog.
 */
private void initialize() {
    PacketAnalyzerResult currentTraceResult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
    PacketAnalyzerResult initialTraceResult = ((MainFrame) parent).getController().getCurrentTraceInitialAnalyzerResult();
    if (currentTraceResult == null) {
        LOGGER.error("Trace result error! ");
        MessageDialogFactory.getInstance().showErrorDialog(FilterApplicationsAndIpDialog.this, "wrong..");
    } else {
        setCurrentPktAnalyzerResult(currentTraceResult);
        setInitialPktAnalyzerResult(initialTraceResult);
        // Save a copy of the filter before user makes any changes to the selection
        cloneFilter();
        this.jIpAddressesTableModel = new FilterIpAddressesTableModel(currentTraceResult.getFilter());
        this.jApplicationsTableModel = new FilterApplicationsTableModel(currentTraceResult.getFilter());
        this.jApplicationsTableModel.addTableModelListener(new TableModelListener() {

            @Override
            public void tableChanged(TableModelEvent e) {
                if (e.getColumn() == FilterApplicationsTableModel.SELECT_COL || e.getColumn() == FilterApplicationsTableModel.COLOR_COL) {
                    for (int row = e.getFirstRow(); row <= e.getLastRow(); ++row) {
                        if (row >= 0 && row < jApplicationsTableModel.getRowCount()) {
                            ApplicationSelection as = jApplicationsTableModel.getValueAt(row);
                            String appName = as.getAppName();
                            for (FilterIpAddressesTableModel.AppIPAddressSelection is : jIpAddressesTableModel.getData()) {
                                if (appName == is.getAppName() || (appName != null && appName.equals(is.getAppName()))) {
                                    if ((as.isSelected() || !is.getIpSelection().isSelected()) && e.getColumn() == FilterApplicationsTableModel.COLOR_COL) {
                                        is.getIpSelection().setColor(as.getColor());
                                    }
                                    if (e.getColumn() == FilterApplicationsTableModel.SELECT_COL) {
                                        is.getIpSelection().setSelected(as.isSelected());
                                    }
                                }
                            }
                        }
                    }
                    jIpAddressesTableModel.fireTableDataChanged();
                }
            }
        });
        this.jIpAddressesTableModel.addTableModelListener(new TableModelListener() {

            @Override
            public void tableChanged(TableModelEvent e) {
                if (e.getColumn() == FilterIpAddressesTableModel.SELECT_COL) {
                    for (int row = e.getFirstRow(); row <= e.getLastRow(); ++row) {
                        if (row >= 0 && row < jIpAddressesTableModel.getRowCount()) {
                            FilterIpAddressesTableModel.AppIPAddressSelection ipSel = jIpAddressesTableModel.getValueAt(row);
                            String appName = ipSel.getAppName();
                            boolean b = ipSel.getIpSelection().isSelected();
                            if (b) {
                                for (FilterIpAddressesTableModel.AppIPAddressSelection is : jIpAddressesTableModel.getData()) {
                                    if (appName == is.getAppName() || (appName != null && appName.equals(is.getAppName()))) {
                                        b &= is.getIpSelection().isSelected();
                                    }
                                }
                            }
                            for (ApplicationSelection as : jApplicationsTableModel.getData()) {
                                if (appName != null && appName.equals(as.getAppName())) {
                                    as.setSelected(b);
                                    break;
                                }
                            }
                            jApplicationsTableModel.fireTableDataChanged();
                        }
                    }
                }
            }
        });
    }
    this.setSize(600, 420);
    this.setModal(true);
    this.setTitle(ResourceBundleHelper.getMessageString(DialogItem.filter_title));
    this.setLayout(new BorderLayout());
    this.add(getMainPanel(), BorderLayout.CENTER);
    this.setLocationRelativeTo(getOwner());
    new EnableEscKeyCloseDialog(getRootPane(), this);
}
Also used : BorderLayout(java.awt.BorderLayout) EnableEscKeyCloseDialog(com.att.aro.ui.commonui.EnableEscKeyCloseDialog) TableModelEvent(javax.swing.event.TableModelEvent) TableModelListener(javax.swing.event.TableModelListener) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Example 17 with PacketAnalyzerResult

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

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

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

use of com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult 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);
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) AROUIPanelException(com.att.aro.ui.exception.AROUIPanelException) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)

Aggregations

PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)37 BaseTest (com.att.aro.core.BaseTest)11 ArrayList (java.util.ArrayList)11 Test (org.junit.Test)11 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)10 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)7 Session (com.att.aro.core.packetanalysis.pojo.Session)7 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)7 AROTraceData (com.att.aro.core.pojo.AROTraceData)6 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)5 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)5 Packet (com.att.aro.core.packetreader.pojo.Packet)5 MainFrame (com.att.aro.ui.view.MainFrame)5 List (java.util.List)5 Profile (com.att.aro.core.configuration.pojo.Profile)4 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)4 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)4 File (java.io.File)4 IBestPractice (com.att.aro.core.bestpractice.IBestPractice)3 BPResultType (com.att.aro.core.bestpractice.pojo.BPResultType)3