Search in sources :

Example 6 with CollectOptions

use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.

the class AttenuationConstantPanel method refresh.

/* (non-Javadoc)
	 * @see com.att.aro.ui.commonui.IUITabPanelLayoutUpdate#refresh(com.att.aro.core.pojo.AROTraceData)
	 */
@Override
public void refresh(AROTraceData analyzerResult) {
    TraceDirectoryResult traceResult = (TraceDirectoryResult) analyzerResult.getAnalyzerResult().getTraceresult();
    CollectOptions collectOptions = traceResult.getCollectOptions();
    refresh(collectOptions);
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)

Example 7 with CollectOptions

use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.

the class CollectOptionsReaderImpl method readData.

@Override
public CollectOptions readData(String directory) {
    String path = directory + Util.FILE_SEPARATOR + TraceDataConst.FileName.COLLECT_OPTIONS;
    CollectOptions collectOptions = new CollectOptions();
    File file = new File(path);
    if (!file.exists()) {
        return collectOptions;
    }
    try {
        List<String> lines = Files.readAllLines(file.toPath());
        collectOptions = lines.size() < 5 ? readOldFormat(lines) : readNewFormat(file);
        logger.info("Collection options: " + "ThrottleDL: " + collectOptions.getThrottleDL() + "ThrottleUL: " + collectOptions.getThrottleUL());
    } catch (IOException | InvalidPathException | NumberFormatException e) {
        logger.error("failed to read collection details file: " + path, e);
    }
    return collectOptions;
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) IOException(java.io.IOException) File(java.io.File) InvalidPathException(java.nio.file.InvalidPathException)

Example 8 with CollectOptions

use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.

the class StatisticsTab method layoutAttenuation.

// hard coded the location of the panel
private void layoutAttenuation(AROTraceData model) {
    TraceDirectoryResult traceResult = (TraceDirectoryResult) model.getAnalyzerResult().getTraceresult();
    CollectOptions collectOptions = traceResult.getCollectOptions();
    if (collectOptions.isAttnrProfile()) {
        if (attenuationProfilePanel == null) {
            attenuationProfilePanel = new AttenuationProfilePanel();
        }
        if (attenuationConstantPanel != null) {
            mainPanel.remove(attenuationConstantPanel);
        }
        attenuationConstantPanel = null;
        mainPanel.add(attenuationProfilePanel, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
        attenuationProfilePanel.refresh(model);
    } else {
        if (attenuationConstantPanel == null) {
            attenuationConstantPanel = new AttenuationConstantPanel();
        }
        if (attenuationProfilePanel != null) {
            mainPanel.remove(attenuationProfilePanel);
        }
        attenuationProfilePanel = null;
        mainPanel.add(attenuationConstantPanel, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
        attenuationConstantPanel.refresh(model);
    }
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) AttenuationProfilePanel(com.att.aro.ui.view.statistics.attenuation.AttenuationProfilePanel) AttenuationConstantPanel(com.att.aro.ui.view.statistics.attenuation.AttenuationConstantPanel)

Example 9 with CollectOptions

use of com.att.aro.core.peripheral.pojo.CollectOptions 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)

Example 10 with CollectOptions

use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.

the class TraceDataReaderImplTest method readTraceDir_.

@Test
public void readTraceDir_() throws IOException {
    String[] time = { "1410212153 1410213352", "272927100", "1410213352.550" };
    String[] appId = { "5", "5", "13", "-127" };
    traceDataReaderImpl.setFileReader(filereader);
    when(filereader.directoryExist(any(String.class))).thenReturn(true);
    when(filereader.fileExist(any(String.class))).thenReturn(true);
    when(filereader.readAllLine(any(String.class))).thenReturn(time);
    when(filereader.readAllLine(Util.getCurrentRunningDir() + Util.FILE_SEPARATOR + "appid")).thenReturn(appId);
    when(filereader.fileExist(Util.getCurrentRunningDir() + Util.FILE_SEPARATOR + "traffic1.cap")).thenReturn(false);
    Map<String, List<ScheduledAlarmInfo>> scheduledAlarms = new HashMap<String, List<ScheduledAlarmInfo>>();
    List<AlarmAnalysisInfo> statistics = new ArrayList<AlarmAnalysisInfo>();
    AlarmAnalysisResult alarmResult = mock(AlarmAnalysisResult.class);
    when(alarmResult.getScheduledAlarms()).thenReturn(scheduledAlarms);
    when(alarmResult.getStatistics()).thenReturn(statistics);
    when(alarmanalysisinfoparser.parse(any(String.class), any(String.class), any(String.class), any(double.class), any(double.class), any(Date.class))).thenReturn(alarmResult);
    // Crypto
    traceDataReaderImpl.setCrypto(crypto);
    when(crypto.readSSLKeys(any(String.class))).thenReturn(1);
    Mockito.doAnswer(new Answer<Object>() {

        public Object answer(InvocationOnMock invocation) {
            byte b = 3;
            short s = 1;
            InetAddress address1 = null;
            InetAddress address2 = null;
            try {
                address2 = InetAddress.getByName("78.46.84.177");
                address1 = InetAddress.getByName("78.46.84.171");
            } catch (UnknownHostException e) {
                e.printStackTrace();
            }
            Date date1 = new Date();
            IPPacket ippack01 = mock(IPPacket.class);
            when(ippack01.getIPVersion()).thenReturn(b);
            when(ippack01.getFragmentOffset()).thenReturn(s);
            when(ippack01.getSourceIPAddress()).thenReturn(address1);
            when(ippack01.getDestinationIPAddress()).thenReturn(address2);
            when(ippack01.getTimeStamp()).thenReturn((double) date1.getTime());
            // pretend jpcap lib
            traceDataReaderImpl.packetArrived("com.google.android.youtube", ippack01);
            return null;
        }
    }).when(packetreader).readPacket(any(String.class), any(IPacketListener.class));
    AppInfo app = new AppInfo();
    Map<String, String> appMap = new HashMap<String, String>();
    appMap.put("flipboard.app", "2.3.8");
    appMap.put("com.att.android.arodatacollector", "3.1.1.6");
    appMap.put("com.google.android.youtube", "4.0.23");
    app.setAppVersionMap(appMap);
    List<String> appInfos = new ArrayList<String>();
    appInfos.add("flipboard.app");
    appInfos.add("com.att.android.arodatacollector");
    appInfos.add("com.google.android.youtube");
    app.setAppInfos(appInfos);
    when(appinforeader.readData(any(String.class))).thenReturn(app);
    DeviceDetail device = new DeviceDetail();
    device.setTotalLines(8);
    device.setScreenSize("720*1280");
    when(devicedetailreader.readData(any(String.class))).thenReturn(device);
    CollectOptions cOptions = new CollectOptions();
    when(collectOptionsReader.readData(any(String.class))).thenReturn(cOptions);
    NetworkTypeObject obj = new NetworkTypeObject();
    when(networktypereader.readData(any(String.class), any(double.class), any(double.class))).thenReturn(obj);
    TraceDirectoryResult result = traceDataReaderImpl.readTraceDirectory(Util.getCurrentRunningDir());
    assertSame(3, result.getAppIds().size());
}
Also used : NetworkTypeObject(com.att.aro.core.peripheral.pojo.NetworkTypeObject) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AlarmAnalysisResult(com.att.aro.core.peripheral.pojo.AlarmAnalysisResult) AlarmAnalysisInfo(com.att.aro.core.peripheral.pojo.AlarmAnalysisInfo) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) ArrayList(java.util.ArrayList) List(java.util.List) UnknownHostException(java.net.UnknownHostException) IPacketListener(com.att.aro.core.packetreader.IPacketListener) DeviceDetail(com.att.aro.core.peripheral.pojo.DeviceDetail) ScheduledAlarmInfo(com.att.aro.core.packetanalysis.pojo.ScheduledAlarmInfo) Date(java.util.Date) AppInfo(com.att.aro.core.peripheral.pojo.AppInfo) CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) InvocationOnMock(org.mockito.invocation.InvocationOnMock) NetworkTypeObject(com.att.aro.core.peripheral.pojo.NetworkTypeObject) InetAddress(java.net.InetAddress) IPPacket(com.att.aro.core.packetreader.pojo.IPPacket) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Aggregations

CollectOptions (com.att.aro.core.peripheral.pojo.CollectOptions)10 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)2 NetworkTypeObject (com.att.aro.core.peripheral.pojo.NetworkTypeObject)2 File (java.io.File)2 IOException (java.io.IOException)2 InvalidPathException (java.nio.file.InvalidPathException)2 BaseTest (com.att.aro.core.BaseTest)1 ScheduledAlarmInfo (com.att.aro.core.packetanalysis.pojo.ScheduledAlarmInfo)1 IPacketListener (com.att.aro.core.packetreader.IPacketListener)1 IPPacket (com.att.aro.core.packetreader.pojo.IPPacket)1 ThermalStatusReaderImpl (com.att.aro.core.peripheral.impl.ThermalStatusReaderImpl)1 AlarmAnalysisInfo (com.att.aro.core.peripheral.pojo.AlarmAnalysisInfo)1 AlarmAnalysisResult (com.att.aro.core.peripheral.pojo.AlarmAnalysisResult)1 AlarmInfo (com.att.aro.core.peripheral.pojo.AlarmInfo)1 AppInfo (com.att.aro.core.peripheral.pojo.AppInfo)1 BatteryInfo (com.att.aro.core.peripheral.pojo.BatteryInfo)1 BluetoothInfo (com.att.aro.core.peripheral.pojo.BluetoothInfo)1 CameraInfo (com.att.aro.core.peripheral.pojo.CameraInfo)1 CpuActivityList (com.att.aro.core.peripheral.pojo.CpuActivityList)1