use of com.att.aro.core.configuration.pojo.Profile in project VideoOptimzer by attdevsupport.
the class ProfileManager method getDefaultProfile.
/**
* Returns the default device profile for the specified profile type (i.e. 3G or LTE)
*
* @param profileType
* The device profile type. One of the values of the Profiletype enumeration.
*
* @return Profile The default profile.
*/
public Profile getDefaultProfile(ProfileType profileType) {
Profile result = null;
// Try default pre-defined
String name = profileType == ProfileType.LTE ? DEFAULT_PROFILE_LTE : DEFAULT_PROFILE;
try {
// aroProfiles.getString(name));
result = getPredefinedProfile(name);
} catch (ProfileException e) {
LOGGER.warn("Unable to load default pre-defined profile: " + profileType.name(), e);
} catch (IOException e) {
LOGGER.warn("Unable to load default pre-defined profile: " + profileType.name(), e);
}
if (result == null) {
return profileType == ProfileType.LTE ? new ProfileLTE() : new Profile3G();
} else {
return result;
}
}
use of com.att.aro.core.configuration.pojo.Profile in project VideoOptimzer by attdevsupport.
the class AROController method propertyChange.
/**
* Not to be directly called. Triggers a re-analysis if a property change is detected.
*/
@Override
public void propertyChange(PropertyChangeEvent event) {
Profile profile = null;
AnalysisFilter filter = null;
try {
theView.hideChartItems();
if (event.getPropertyName().equals("tracePath")) {
// to filter or not to filter
String path;
TimeRange timeRange = null;
if (event.getNewValue() instanceof TimeRange) {
timeRange = (TimeRange) event.getNewValue();
path = timeRange.getPath();
if (path != null) {
filter = new AnalysisFilter(null, timeRange, null);
} else {
LOG.error("Invalid use of TimeRange here, it needs to hold a valid path, to finish creating a filter");
}
} else {
path = (String) event.getNewValue();
if ((path != null) && (timeRange = checkForDefaultTimeRange((String) event.getNewValue())) != null) {
// timeRange contains TimeRangeType.Default, so continue with analysis with filter
filter = new AnalysisFilter(null, timeRange, null);
}
}
updateModel(path, profile, filter);
} else if (event.getPropertyName().equals("profile")) {
if (theModel.getAnalyzerResult() != null) {
filter = theModel.getAnalyzerResult().getFilter();
}
if (theModel.isSuccess()) {
updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceDirectory(), (Profile) event.getNewValue(), filter);
}
} else if (event.getPropertyName().equals("filter")) {
if (theModel.getAnalyzerResult() != null) {
profile = theModel.getAnalyzerResult().getProfile();
}
if (theModel.getAnalyzerResult().getTraceresult().getTraceFile() != null && !theModel.getAnalyzerResult().getTraceresult().getTraceFile().equals("")) {
updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceFile(), profile, (AnalysisFilter) event.getNewValue());
} else {
updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceDirectory(), profile, (AnalysisFilter) event.getNewValue());
}
}
} finally {
if (theModel.getAnalyzerResult() != null) {
if (theModel.getAnalyzerResult().getStreamingVideoData() == null || theModel.getAnalyzerResult().getStreamingVideoData().isFinished()) {
theView.showChartItems(HIDE_SHOW_CHARTPLOTOPTIONS);
} else {
// turn off chunks plot
theView.hideChartItems(HIDE_SHOW_CHARTPLOTOPTIONS);
// show everything that is not otherwise hidden
theView.showChartItems();
}
}
}
}
use of com.att.aro.core.configuration.pojo.Profile in project VideoOptimzer by attdevsupport.
the class TimeRangeAnalysis method performTimeRangeAnalysis.
/**
* Performs a TimeRangeAnalysis on the trace data.
* TODO: The calculation should not be in the UI - move elsewhere (Core)
*
* @return TimeRangeAnalysis The object containing TimeRangeAnalysis
* data.
*/
public static TimeRangeAnalysis performTimeRangeAnalysis(PacketAnalyzerResult analysisData, double analyzeBeginTime, double analyzeEndTime) {
List<RrcStateRange> rrcCollection = analysisData.getStatemachine().getStaterangelist();
List<PacketInfo> packets = analysisData.getTraceresult().getAllpackets();
Profile profile = analysisData.getProfile();
long payloadLength = 0;
long totalBytes = 0;
long uplinkBytes = 0;
long downlinkBytes = 0;
int packetNum = packets.size();
for (int i = 0; i < packetNum; i++) {
PacketInfo packetInfo = packets.get(i);
if (packetInfo.getTimeStamp() >= analyzeBeginTime && packetInfo.getTimeStamp() <= analyzeEndTime) {
payloadLength += packetInfo.getPayloadLen();
totalBytes += packetInfo.getLen();
if (packetInfo.getDir().equals(PacketDirection.UPLINK)) {
uplinkBytes += packetInfo.getLen();
} else if (packetInfo.getDir().equals(PacketDirection.DOWNLINK)) {
downlinkBytes += packetInfo.getLen();
}
}
}
double energy = 0.0f;
double activeTime = 0.0f;
int collectionSize = rrcCollection.size();
for (int i = 0; i < collectionSize; i++) {
double beginTime;
double endTime;
RrcStateRange rrc = rrcCollection.get(i);
if (rrc.getEndTime() < analyzeBeginTime) {
continue;
}
if (rrc.getBeginTime() > analyzeEndTime) {
continue;
}
if (rrc.getBeginTime() >= analyzeBeginTime) {
beginTime = rrc.getBeginTime();
} else {
beginTime = analyzeBeginTime;
}
if (rrc.getEndTime() <= analyzeEndTime) {
endTime = rrc.getEndTime();
} else {
endTime = analyzeEndTime;
}
RRCState rrcState = rrc.getState();
IProfileFactory profileFactory = ContextAware.getAROConfigContext().getBean(IProfileFactory.class);
energy += updateEnergy(analysisData, profile, beginTime, endTime, rrcState, profileFactory);
activeTime += updateActiveTime(profile, beginTime, endTime, rrcState);
}
return new TimeRangeAnalysis(analyzeBeginTime, analyzeEndTime, totalBytes, uplinkBytes, downlinkBytes, payloadLength, activeTime, energy);
}
use of com.att.aro.core.configuration.pojo.Profile in project VideoOptimzer by attdevsupport.
the class RrcPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
if (analysis != null) {
rrcDataCollection.removeAllSeries();
Map<RRCState, XYIntervalSeries> seriesMap = new EnumMap<RRCState, XYIntervalSeries>(RRCState.class);
for (RRCState eventType : RRCState.values()) {
XYIntervalSeries series = new XYIntervalSeries(eventType);
seriesMap.put(eventType, series);
rrcDataCollection.addSeries(series);
}
List<RrcStateRange> rrcStates = analysis.getAnalyzerResult().getStatemachine().getStaterangelist();
Iterator<RrcStateRange> iter = rrcStates.iterator();
while (iter.hasNext()) {
RrcStateRange currEvent = iter.next();
RRCState state = currEvent.getState();
if (state == RRCState.STATE_FACH || state == RRCState.TAIL_FACH) {
seriesMap.get(state).add(currEvent.getBeginTime(), currEvent.getBeginTime(), currEvent.getEndTime(), 0.25, 0, 0.5);
} else {
seriesMap.get(state).add(currEvent.getBeginTime(), currEvent.getBeginTime(), currEvent.getEndTime(), 0.5, 0, 1);
}
}
XYItemRenderer renderer = plot.getRenderer();
Color dchGreen = new Color(34, 177, 76);
Color fachOrange = new Color(255, 201, 14);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.STATE_IDLE), Color.white);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_IDLE), Color.white);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.PROMO_IDLE_DCH), Color.red);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_PROMOTION), Color.red);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.STATE_DCH), fachOrange);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_CONTINUOUS), fachOrange);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.TAIL_DCH), getTailPaint(fachOrange));
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_CR_TAIL), getTailPaint(fachOrange));
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_DRX_SHORT), getTailPaint(fachOrange));
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.LTE_DRX_LONG), getTailPaint(fachOrange));
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.STATE_FACH), dchGreen);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.TAIL_FACH), getTailPaint(dchGreen));
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.PROMO_FACH_DCH), Color.red);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.WIFI_IDLE), Color.white);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.WIFI_ACTIVE), fachOrange);
renderer.setSeriesPaint(rrcDataCollection.indexOf(RRCState.WIFI_TAIL), getTailPaint(fachOrange));
// Assign ToolTip to renderer
final Profile profile = analysis.getAnalyzerResult().getProfile();
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
RRCState eventType = (RRCState) rrcDataCollection.getSeries(series).getKey();
final String PREFIX = "RRCTooltip.";
if (eventType == RRCState.LTE_IDLE && profile instanceof ProfileLTE) {
return MessageFormat.format(ResourceBundleHelper.getMessageString(PREFIX + eventType), ((ProfileLTE) profile).getIdlePingPeriod());
}
return ResourceBundleHelper.getMessageString(PREFIX + eventType);
}
});
}
plot.setDataset(rrcDataCollection);
// return plot;
}
use of com.att.aro.core.configuration.pojo.Profile in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImpl method create.
@Override
public Profile create(ProfileType typeParm, Properties prop) {
Profile prof = null;
ProfileType type = typeParm == null ? ProfileType.LTE : typeParm;
switch(type) {
case LTE:
prof = createLTE(prop);
break;
case T3G:
prof = create3G(prop);
break;
case WIFI:
prof = createWiFi(prop);
break;
default:
return null;
}
return prof;
}
Aggregations