Changeset 1396 for DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
- Timestamp:
- 06/26/14 14:18:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
r1374 r1396 59 59 import schedframe.ExecutablesList; 60 60 import schedframe.SimulatedEnvironment; 61 import schedframe. exceptions.ResourceException;61 import schedframe.resources.CustomResourceType; 62 62 import schedframe.resources.ResourceType; 63 import schedframe.resources.UserResourceType;64 63 import schedframe.resources.computing.ComputingResource; 65 import schedframe.resources.computing.Processor;66 64 import schedframe.resources.computing.extensions.Extension; 67 65 import schedframe.resources.computing.extensions.ExtensionList; … … 69 67 import schedframe.resources.computing.profiles.energy.EnergyExtension; 70 68 import schedframe.resources.computing.profiles.energy.MeasurementHistory; 71 import schedframe.resources.computing.profiles.energy.airthroughput.Air FlowValue;69 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 72 70 import schedframe.resources.computing.profiles.energy.power.PowerUsage; 73 71 import schedframe.resources.computing.profiles.energy.thermal.TemperatureValue; … … 80 78 import schedframe.resources.units.StandardResourceUnitName; 81 79 import schedframe.scheduling.ExecutionHistoryItem; 82 import schedframe.scheduling.Resource HistoryItem;80 import schedframe.scheduling.ResourceItem; 83 81 import schedframe.scheduling.Scheduler; 84 82 import schedframe.scheduling.manager.tasks.JobRegistry; … … 91 89 import simulator.GenericUser; 92 90 import simulator.stats.CoolEmAllMetricsCalculator; 91 import simulator.stats.DCwormsAccumulator; 93 92 import simulator.stats.DCwormsMetricsCalculator; 94 import simulator.stats.GSSAccumulator;95 93 import simulator.stats.MetricsCalculator; 96 94 import simulator.stats.SimulationStatistics; … … 124 122 protected static final String RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.txt"; 125 123 protected static final String ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "EnergyUsage.txt"; 126 protected static final String AIRFLOW_STATISTICS_OUTPUT_FILE_NAME = "Air Throughput.txt";124 protected static final String AIRFLOW_STATISTICS_OUTPUT_FILE_NAME = "Airflow.txt"; 127 125 protected static final String TEMPERATURE_STATISTICS_OUTPUT_FILE_NAME = "Temperature.txt"; 128 126 protected static final String USEFUL_WORK_STATISTICS_OUTPUT_FILE_NAME = "UsefulWork.txt"; … … 144 142 145 143 protected GSSAccumulatorsStats accStats; 146 protected Map<String, GSSAccumulator> statsData;144 protected Map<String, DCwormsAccumulator> statsData; 147 145 148 146 protected GenericUser users; … … 232 230 task_processorsMap = new HashMap<String, Set<ComputingResource>>(); 233 231 accStats = new GSSAccumulatorsStats(); 234 statsData = new HashMap<String, GSSAccumulator>();232 statsData = new HashMap<String, DCwormsAccumulator>(); 235 233 236 234 this.serializer = new StringSerializer(); … … 298 296 cStats.add(Stats.chartEnergy); 299 297 cStats.add(Stats.textAirFlow); 300 if(ArrayUtils.contains(configuration.resForAir FlowChart, resourceTypeName))298 if(ArrayUtils.contains(configuration.resForAirflowChart, resourceTypeName)) 301 299 cStats.add(Stats.chartAirFlow); 302 300 cStats.add(Stats.textTemperature); … … 420 418 List<ComputingResource> compResources = null; 421 419 for(String resourceTypeName: resourceController.getComputingResourceLayers()){ 422 GSSAccumulator resourceEnergyAccumulator = new GSSAccumulator();423 GSSAccumulator maxResourceEnergyAccumulator = new GSSAccumulator();424 GSSAccumulator calculationsEnergyAccumulator = new GSSAccumulator();420 DCwormsAccumulator resourceEnergyAccumulator = new DCwormsAccumulator(); 421 DCwormsAccumulator maxResourceEnergyAccumulator = new DCwormsAccumulator(); 422 DCwormsAccumulator calculationsEnergyAccumulator = new DCwormsAccumulator(); 425 423 compResources = new ArrayList<ComputingResource>(); 426 424 for(ComputingResource compRes: resourceController.getComputingResources() ){ 427 compResources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceTypeName)));425 compResources.addAll(compRes.getDescendantsByType(new CustomResourceType(resourceTypeName))); 428 426 } 429 427 if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceTypeName)) … … 526 524 527 525 for(Device device: compResource.getResourceCharacteristic().getDevices()){ 528 GSSAccumulator devAccumulator = new GSSAccumulator();526 DCwormsAccumulator devAccumulator = new DCwormsAccumulator(); 529 527 ResourcePowerStats deviceEnergyUsage = gatherResourcePowerConsumptionStats(device); 530 528 deviceEnergyUsage.setMeanValue(calculateMeanValue(deviceEnergyUsage)); … … 592 590 } 593 591 594 if(ArrayUtils.contains(configuration.resForAir FlowChart, device.getType().getName())){592 if(ArrayUtils.contains(configuration.resForAirflowChart, device.getType().getName())){ 595 593 if (configuration.creatediagrams_resairflow) { 596 594 createResourceAirFlowDiagramData(deviceAirFlow); … … 767 765 768 766 769 LinkedList<Resource HistoryItem> resourceHistory = exec.getAllocatedResources();767 LinkedList<ResourceItem> resourceHistory = exec.getAllocatedResources(); 770 768 if(resourceHistory.size() == 0) 771 769 continue; … … 805 803 806 804 try{ 807 double usefulWork = execTask.get ResourceConsumptionProfile().getUsefulWork()/pes.size();805 double usefulWork = execTask.getExecutionProfile().getUsefulWork()/pes.size(); 808 806 //double usefulWork = gatherUsefulWorkStats(pe).getValue(); 809 GSSAccumulator uwAcc;807 DCwormsAccumulator uwAcc; 810 808 if(metCalc.getMetricsData().containsKey("UW_" + pe.getFullName())){ 811 809 uwAcc = metCalc.getMetricsData().get("UW_" + pe.getFullName()).get(0); 812 810 uwAcc.add(usefulWork); 813 811 } else { 814 uwAcc = new GSSAccumulator();812 uwAcc = new DCwormsAccumulator(); 815 813 uwAcc.add(usefulWork); 816 814 metCalc.addMetricsData("UW_" + pe.getFullName(), uwAcc); … … 832 830 Executable exec = (Executable) execTask; 833 831 834 LinkedList<Resource HistoryItem> resourceHistory = exec.getAllocatedResources();832 LinkedList<ResourceItem> resourceHistory = exec.getAllocatedResources(); 835 833 if(resourceHistory.size() == 0) 836 834 continue; 837 835 838 836 for(int i = 0; i < resourceHistory .size(); i++){ 839 Resource HistoryItem resHistItem = resourceHistory.get(i);837 ResourceItem resHistItem = resourceHistory.get(i); 840 838 Map<ResourceUnitName, ResourceUnit> res = resHistItem.getResourceUnits(); 841 839 ResourceUnit resUnit = res.get(StandardResourceUnitName.PE); 842 840 //ProcessingElements pes = (ProcessingElements) resUnit ; 843 LinkedList<ExecutionHistoryItem> execHistory = exec.getExec History();841 LinkedList<ExecutionHistoryItem> execHistory = exec.getExecutionHistory(); 844 842 long st = -1, et; 845 843 for(int j = 0; j < execHistory .size(); j++){ … … 893 891 894 892 try{ 895 double usefulWork = execTask.get ResourceConsumptionProfile().getUsefulWork()/pes.size();893 double usefulWork = execTask.getExecutionProfile().getUsefulWork()/pes.size(); 896 894 usefulWork = ((et - st) / (1000 * getExecutionTime(execTask))) * usefulWork; 897 GSSAccumulator uwAcc;895 DCwormsAccumulator uwAcc; 898 896 if(metCalc.getMetricsData().containsKey("UW_" + pe.getFullName())){ 899 897 uwAcc = metCalc.getMetricsData().get("UW_" + pe.getFullName()).get(0); 900 898 uwAcc.add(usefulWork); 901 899 } else { 902 uwAcc = new GSSAccumulator();900 uwAcc = new DCwormsAccumulator(); 903 901 uwAcc.add(usefulWork); 904 902 metCalc.addMetricsData("UW_" + pe.getFullName(), uwAcc); … … 922 920 long previousTimestamp = 0; 923 921 int previousStatus = DCWormsTags.CREATED; 924 for(ExecutionHistoryItem execHistItem: execTask.getExec History()){922 for(ExecutionHistoryItem execHistItem: execTask.getExecutionHistory()){ 925 923 if(previousStatus == DCWormsTags.INEXEC){ 926 924 executionTime = executionTime + (execHistItem.getTimeStamp().getMillis()/1000 - previousTimestamp); … … 1033 1031 JobRegistry jr = new JobRegistryImpl(compResource.getFullName()); 1034 1032 for(ExecTask task: jr.getFinishedTasks()){ 1035 usefulWork = usefulWork + task.get ResourceConsumptionProfile().getUsefulWork();1033 usefulWork = usefulWork + task.getExecutionProfile().getUsefulWork(); 1036 1034 } 1037 1035 ResourceUsefulWorkStats usefulWorkStats = new ResourceUsefulWorkStats(compResource.getFullName(), compResource.getType(), usageType, usefulWork, endSimulationTime); … … 1175 1173 if(ee.getAirFlowProfile() == null) 1176 1174 break; 1177 List<Air FlowValue> airFlowHistory = ee.getAirFlowProfile().getAirThroughputHistory();1175 List<AirflowValue> airFlowHistory = ee.getAirFlowProfile().getAirflowHistory(); 1178 1176 if(airFlowHistory.size() == 0) 1179 1177 break; 1180 1178 long endSimulationTime = DateTimeUtilsExt.currentTimeMillis(); 1181 airFlowHistory.add(new Air FlowValue(endSimulationTime, ee.getAirFlowProfile().getAirThroughputHistory().get(ee.getAirFlowProfile().getAirThroughputHistory().size()-1).getValue()));1182 for(Air FlowValue af:airFlowHistory){1179 airFlowHistory.add(new AirflowValue(endSimulationTime, ee.getAirFlowProfile().getAirflowHistory().get(ee.getAirFlowProfile().getAirflowHistory().size()-1).getValue())); 1180 for(AirflowValue af:airFlowHistory){ 1183 1181 airFlow.put(af.getTimestamp(), af.getValue()); 1184 1182 } … … 1402 1400 resourceAirFlowDiagram = getResourceDynamicDiagram(resourceAirFlowDiagrams.get(resType), simulationTime, chartName, 1403 1401 subtitle, axisName); 1404 if (!saveXYPlotChart(resourceAirFlowDiagram, fileName + "Air Throughput_" + resType))1402 if (!saveXYPlotChart(resourceAirFlowDiagram, fileName + "Airflow_" + resType)) 1405 1403 return false; 1406 1404 } … … 2040 2038 } 2041 2039 2042 public GSSAccumulator getStats(String name) {2040 public DCwormsAccumulator getStats(String name) { 2043 2041 return statsData.get(name); 2044 2042 }
Note: See TracChangeset
for help on using the changeset viewer.