Search in sources :

Example 6 with RrcStateMachine3G

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

the class TraceBenchmarkChartPanel method generateDataForChart.

public TraceBenchmarkInfo generateDataForChart() {
    TraceBenchmarkInfo traceBenchmarkPojo = new TraceBenchmarkInfo();
    if (traceModel != null && traceModel.getAnalyzerResult() != null) {
        double averageKbps = traceModel.getAnalyzerResult().getStatistic().getAverageKbps();
        traceBenchmarkPojo.setThroughputPct(ApplicationSampling.getInstance().getThroughputPercentile(averageKbps));
        double totalKbps = traceModel.getAnalyzerResult().getStatistic().getTotalByte() / 1024;
        traceBenchmarkPojo.setKbps(totalKbps);
        double promo = 0.0;
        double joulesPerKbps = 0.0;
        switch(traceModel.getAnalyzerResult().getStatemachine().getType()) {
            case Type3G:
                RrcStateMachine3G rrcState3G = (RrcStateMachine3G) traceModel.getAnalyzerResult().getStatemachine();
                joulesPerKbps = rrcState3G.getJoulesPerKilobyte();
                promo = rrcState3G.getPromotionRatio();
                break;
            case LTE:
                RrcStateMachineLTE rrcStateLTE = (RrcStateMachineLTE) traceModel.getAnalyzerResult().getStatemachine();
                joulesPerKbps = rrcStateLTE.getJoulesPerKilobyte();
                promo = rrcStateLTE.getLteDrxLongRatio();
                break;
            case WiFi:
                RrcStateMachineWiFi rrcStateWifi = (RrcStateMachineWiFi) traceModel.getAnalyzerResult().getStatemachine();
                joulesPerKbps = rrcStateWifi.getJoulesPerKilobyte();
                promo = (rrcStateWifi.getWifiIdleTime() + rrcStateWifi.getWifiActiveTime()) / rrcStateWifi.getPacketsDuration();
                break;
            default:
                break;
        }
        traceBenchmarkPojo.setJpkb(joulesPerKbps);
        traceBenchmarkPojo.setJpkbPct(ApplicationSampling.getInstance().getJpkbPercentile(joulesPerKbps));
        traceBenchmarkPojo.setPromotionRatioPct(promo);
        traceBenchmarkPojo.setPromoRatioPercentail(ApplicationSampling.getInstance().getPromoRatioPercentile(promo));
    }
    return traceBenchmarkPojo;
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RrcStateMachineLTE(com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE) TraceBenchmarkInfo(com.att.aro.ui.model.overview.TraceBenchmarkInfo) RrcStateMachineWiFi(com.att.aro.core.packetanalysis.pojo.RrcStateMachineWiFi)

Example 7 with RrcStateMachine3G

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

the class EnergyModelStatistics3GPanel method refreshRRCStatistic.

/**
 * Refreshes various label values in the EnergyModelStatistics3GPanel when a
 * trace is loaded.
 *
 * @param analysis
 *          - The Analysis object containing the trace data.
 * @param nf
 * 			- The number format used to display the label values.
 */
public void refreshRRCStatistic(AROTraceData analysis, NumberFormat nf) {
    if (analysis != null) {
        RrcStateMachine3G rrc = (RrcStateMachine3G) analysis.getAnalyzerResult().getStatemachine();
        dchValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getDchEnergy())));
        fachValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getFachEnergy())));
        idleValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getIdleEnergy())));
        idle2dchValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getIdleToDchEnergy())));
        fach2dchValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getFachToDchEnergy())));
        dchTailValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getDchTailEnergy())));
        fachTailValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getFachTailEnergy())));
        rrcTotalValueLabel.setText(MessageFormat.format(units, nf.format(rrc.getTotalRRCEnergy())));
        jpkbValueLabel.setText(nf.format(rrc.getJoulesPerKilobyte()));
        energyContent.put(rb.getString("energy.dch"), dchValueLabel.getText());
        energyContent.put(rb.getString("energy.fach"), fachValueLabel.getText());
        energyContent.put(rb.getString("energy.idle"), idleValueLabel.getText());
        energyContent.put(rb.getString("energy.idle2dch"), idle2dchValueLabel.getText());
        energyContent.put(rb.getString("energy.fach2dch"), fach2dchValueLabel.getText());
        energyContent.put(rb.getString("energy.dchTail"), dchTailValueLabel.getText());
        energyContent.put(rb.getString("energy.fachTail"), fachTailValueLabel.getText());
        energyContent.put(rb.getString("energy.rrcTotal"), rrcTotalValueLabel.getText());
        energyContent.put(rb.getString("energy.jpkb"), jpkbValueLabel.getText());
    } else {
        dchValueLabel.setText(null);
        fachValueLabel.setText(null);
        idleValueLabel.setText(null);
        idle2dchValueLabel.setText(null);
        fach2dchValueLabel.setText(null);
        dchTailValueLabel.setText(null);
        fachTailValueLabel.setText(null);
        rrcTotalValueLabel.setText(null);
        jpkbValueLabel.setText(null);
    }
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)

Example 8 with RrcStateMachine3G

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

the class RrcStateMachineFactoryImplTest method create_T3GStateIsSTATE_FACH.

@Test
public void create_T3GStateIsSTATE_FACH() {
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
    Profile3G profile12 = mock(Profile3G.class);
    when(profile12.getProfileType()).thenReturn(ProfileType.T3G);
    List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
    RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
    for (int i = 0; i < 5; i++) {
        rrcStateRangeArray[i] = mock(RrcStateRange.class);
        when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.STATE_FACH);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
    }
    for (int i = 0; i < 5; i++) {
        staterangelist.add(rrcStateRangeArray[i]);
    }
    when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile12, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getFachTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getFachEnergy(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 9 with RrcStateMachine3G

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

the class RrcStateMachineFactoryImplTest method create_T3GStateIsPROMO_IDLE_DCH.

@Test
public void create_T3GStateIsPROMO_IDLE_DCH() {
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
    Profile3G profile14 = mock(Profile3G.class);
    when(profile14.getProfileType()).thenReturn(ProfileType.T3G);
    List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
    RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
    for (int i = 0; i < 5; i++) {
        rrcStateRangeArray[i] = mock(RrcStateRange.class);
        when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.PROMO_IDLE_DCH);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
    }
    for (int i = 0; i < 5; i++) {
        staterangelist.add(rrcStateRangeArray[i]);
    }
    when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile14, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(5, rrcStateMachine3G.getIdleToDch(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getIdleToDchTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getIdleToDchEnergy(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 10 with RrcStateMachine3G

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

the class RrcStateMachineFactoryImplTest method create_T3GStateIsSTATE_IDLE.

@Test
public void create_T3GStateIsSTATE_IDLE() {
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
    Profile3G profile10 = mock(Profile3G.class);
    when(profile10.getProfileType()).thenReturn(ProfileType.T3G);
    List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
    RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
    for (int i = 0; i < 5; i++) {
        rrcStateRangeArray[i] = mock(RrcStateRange.class);
        when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.STATE_IDLE);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
    }
    for (int i = 0; i < 5; i++) {
        staterangelist.add(rrcStateRangeArray[i]);
    }
    when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile10, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getIdleTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getIdleEnergy(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Aggregations

RrcStateMachine3G (com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)13 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)9 BaseTest (com.att.aro.core.BaseTest)8 Profile (com.att.aro.core.configuration.pojo.Profile)8 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)8 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)8 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)8 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)7 RrcStateMachineLTE (com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE)1 RrcStateMachineWiFi (com.att.aro.core.packetanalysis.pojo.RrcStateMachineWiFi)1 AROUIPanelException (com.att.aro.ui.exception.AROUIPanelException)1 TraceBenchmarkInfo (com.att.aro.ui.model.overview.TraceBenchmarkInfo)1