Search in sources :

Example 6 with ProfileWiFi

use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.

the class ProfileFactoryImplTest method saveWiFi_.

@Test
public void saveWiFi_() throws IOException {
    OutputStream output = Mockito.mock(OutputStream.class);
    ProfileWiFi profileWifi = Mockito.mock(ProfileWiFi.class);
    when(profileWifi.getCarrier()).thenReturn("AT&T");
    when(profileWifi.getDevice()).thenReturn("Captivate - ad study");
    when(profileWifi.getProfileType()).thenReturn(ProfileType.LTE);
    when(profileWifi.getUserInputTh()).thenReturn(1.0);
    when(profileWifi.getPowerGpsActive()).thenReturn(1.0);
    when(profileWifi.getPowerGpsStandby()).thenReturn(0.5);
    when(profileWifi.getPowerCameraOn()).thenReturn(0.3);
    when(profileWifi.getPowerBluetoothActive()).thenReturn(1.0);
    when(profileWifi.getPowerBluetoothStandby()).thenReturn(0.5);
    when(profileWifi.getPowerScreenOn()).thenReturn(0.3);
    when(profileWifi.getBurstTh()).thenReturn(1.5);
    when(profileWifi.getLongBurstTh()).thenReturn(5.0);
    when(profileWifi.getPeriodMinCycle()).thenReturn(10.0);
    when(profileWifi.getPeriodCycleTol()).thenReturn(1.0);
    when(profileWifi.getLargeBurstDuration()).thenReturn(5.0);
    when(profileWifi.getLargeBurstSize()).thenReturn(100000);
    when(profileWifi.getCloseSpacedBurstThreshold()).thenReturn(10.0);
    when(profileWifi.getThroughputWindow()).thenReturn(0.5);
    profilefactory.saveWiFi(output, profileWifi);
}
Also used : OutputStream(java.io.OutputStream) ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 7 with ProfileWiFi

use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.

the class ProfileFactoryImplTest method energyWifi_RRCStateIsWIFI_ACTIVE.

@Test
public void energyWifi_RRCStateIsWIFI_ACTIVE() {
    ProfileWiFi profileWifi = Mockito.mock(ProfileWiFi.class);
    when(profileWifi.getWifiActivePower()).thenReturn(2.0);
    double testResult = profilefactory.energyWiFi(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.WIFI_ACTIVE, profileWifi);
    assertEquals(2000.0, testResult, 0.0);
}
Also used : ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 8 with ProfileWiFi

use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.

the class BurstCollectionAnalysisImpl method computeBurstEnergyRadioResource.

/**
 * Computes the total burst energy.
 * @return
 */
private double computeBurstEnergyRadioResource(List<RrcStateRange> rrcstaterangelist, List<Burst> burstCollection, Profile profile) {
    List<RrcStateRange> rrcCollection = rrcstaterangelist;
    int rrcCount = rrcCollection.size();
    if (rrcCount == 0) {
        return 0;
    }
    int pCount = 0;
    double time2 = -1;
    double totalEnergy = 0.0f;
    Iterator<Burst> iter = burstCollection.iterator();
    Burst currentBurst = iter.next();
    double time1 = rrcCollection.get(0).getBeginTime();
    while (true) {
        Burst nextBurst = iter.hasNext() ? iter.next() : null;
        time2 = nextBurst != null ? nextBurst.getBeginTime() : rrcCollection.get(rrcCount - 1).getEndTime();
        double energy = 0.0f;
        double activeTime = 0.0f;
        while (pCount < rrcCount) {
            RrcStateRange rrCntrl = rrcCollection.get(pCount);
            if (rrCntrl.getEndTime() < time1) {
                pCount++;
            } else {
                if (time2 > rrCntrl.getEndTime()) {
                    if (profile.getProfileType() == ProfileType.T3G) {
                        energy += profilefactory.energy3G(time1, rrCntrl.getEndTime(), rrCntrl.getState(), (Profile3G) profile);
                    } else if (profile.getProfileType() == ProfileType.LTE) {
                        energy += rrCntrl.getEnergy();
                    } else if (profile.getProfileType() == ProfileType.WIFI) {
                        energy += profilefactory.energyWiFi(time1, rrCntrl.getEndTime(), rrCntrl.getState(), (ProfileWiFi) profile);
                    }
                    if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
                        activeTime += rrCntrl.getEndTime() - time1;
                    }
                    pCount++;
                }
                break;
            }
        }
        while (pCount < rrcCount) {
            RrcStateRange rrCntrl = rrcCollection.get(pCount);
            if (rrCntrl.getEndTime() < time2) {
                if (profile.getProfileType() == ProfileType.T3G) {
                    energy += profilefactory.energy3G(Math.max(rrCntrl.getBeginTime(), time1), rrCntrl.getEndTime(), rrCntrl.getState(), (Profile3G) profile);
                } else if (profile.getProfileType() == ProfileType.LTE) {
                    energy += rrCntrl.getEnergy();
                } else if (profile.getProfileType() == ProfileType.WIFI) {
                    energy += profilefactory.energyWiFi(Math.max(rrCntrl.getBeginTime(), time1), rrCntrl.getEndTime(), rrCntrl.getState(), (ProfileWiFi) profile);
                }
                if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
                    activeTime += rrCntrl.getEndTime() - Math.max(rrCntrl.getBeginTime(), time1);
                }
                pCount++;
            } else {
                if (profile.getProfileType() == ProfileType.T3G) {
                    energy += profilefactory.energy3G(Math.max(rrCntrl.getBeginTime(), time1), time2, rrCntrl.getState(), (Profile3G) profile);
                } else if (profile.getProfileType() == ProfileType.LTE) {
                    energy += rrCntrl.getEnergy();
                } else if (profile.getProfileType() == ProfileType.WIFI) {
                    energy += profilefactory.energyWiFi(Math.max(rrCntrl.getBeginTime(), time1), time2, rrCntrl.getState(), (ProfileWiFi) profile);
                }
                if ((rrCntrl.getState() == RRCState.STATE_DCH || rrCntrl.getState() == RRCState.TAIL_DCH) || (rrCntrl.getState() == RRCState.LTE_CONTINUOUS || rrCntrl.getState() == RRCState.LTE_CR_TAIL) || (rrCntrl.getState() == RRCState.WIFI_ACTIVE || rrCntrl.getState() == RRCState.WIFI_TAIL)) {
                    activeTime += time2 - Math.max(rrCntrl.getBeginTime(), time1);
                }
                break;
            }
        }
        currentBurst.setEnergy(energy);
        totalEnergy += energy;
        currentBurst.setActiveTime(activeTime);
        time1 = time2;
        if (nextBurst != null) {
            currentBurst = nextBurst;
        } else {
            break;
        }
    }
    return totalEnergy;
}
Also used : Burst(com.att.aro.core.packetanalysis.pojo.Burst) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi)

Example 9 with ProfileWiFi

use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImpl method create.

@Override
public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) {
    List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration);
    if (timerange != null) {
        staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime());
    }
    AbstractRrcStateMachine data = null;
    if (profile.getProfileType() == ProfileType.T3G) {
        data = run3GRRcStatistics(staterangelist, (Profile3G) profile, totalBytes, packetDuration, traceDuration);
    } else if (profile.getProfileType() == ProfileType.LTE) {
        data = runLTERRcStatistics(staterangelist, (ProfileLTE) profile, packetlist, totalBytes, packetDuration, traceDuration);
    } else if (profile.getProfileType() == ProfileType.WIFI) {
        data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi) profile, totalBytes, packetDuration, traceDuration);
    }
    if (data != null) {
        data.setStaterangelist(staterangelist);
    }
    return data;
}
Also used : RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) AbstractRrcStateMachine(com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine) ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi)

Example 10 with ProfileWiFi

use of com.att.aro.core.configuration.pojo.ProfileWiFi in project VideoOptimzer by attdevsupport.

the class ProfileFactoryImpl method createWiFi.

@Override
public Profile createWiFi(Properties properties) {
    ProfileWiFi prof = new ProfileWiFi();
    this.createBaseData(prof, properties);
    prof.setDevice(readString(properties, ProfileLTE.DEVICE, "Default WiFi Device"));
    prof.setWifiTailTime(readDouble(properties, ProfileWiFi.WIFI_TAIL_TIME, 0.25));
    prof.setWifiActivePower(readDouble(properties, ProfileWiFi.POWER_WIFI_ACTIVE, 0.403));
    prof.setWifiIdlePower(readDouble(properties, ProfileWiFi.POWER_WIFI_STANDBY, 0.02));
    return prof;
}
Also used : ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi)

Aggregations

ProfileWiFi (com.att.aro.core.configuration.pojo.ProfileWiFi)15 BaseTest (com.att.aro.core.BaseTest)12 Test (org.junit.Test)12 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)9 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)7 ArrayList (java.util.ArrayList)7 Profile (com.att.aro.core.configuration.pojo.Profile)4 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)4 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)3 RrcStateMachineWiFi (com.att.aro.core.packetanalysis.pojo.RrcStateMachineWiFi)3 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)2 Burst (com.att.aro.core.packetanalysis.pojo.Burst)1 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)1 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)1 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)1 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)1 CpuActivity (com.att.aro.core.peripheral.pojo.CpuActivity)1 UserEvent (com.att.aro.core.peripheral.pojo.UserEvent)1