Changeset 490 for DCWoRMS/trunk/src/simulator/stats/implementation
- Timestamp:
- 10/09/12 13:58:06 (13 years ago)
- Location:
- DCWoRMS/trunk/src/simulator/stats/implementation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
r481 r490 19 19 import java.util.TreeMap; 20 20 21 import org.apache.commons.lang.ArrayUtils; 21 22 import org.apache.commons.logging.Log; 22 23 import org.apache.commons.logging.LogFactory; … … 55 56 import schedframe.exceptions.ResourceException; 56 57 import schedframe.resources.ResourceType; 57 import schedframe.resources. StandardResourceType;58 import schedframe.resources.UserResourceType; 58 59 import schedframe.resources.computing.ComputingResource; 59 60 import schedframe.resources.computing.extensions.Extension; … … 87 88 import csiro.mit.utils.jfreechart.timetablechart.data.TimetableEventSource; 88 89 import csiro.mit.utils.jfreechart.timetablechart.renderer.TimetableRenderer; 90 import dcworms.schedframe.scheduling.ExecTask; 91 import dcworms.schedframe.scheduling.Executable; 89 92 import eduni.simjava.Sim_stat; 90 import gssim.schedframe.scheduling.ExecTask;91 import gssim.schedframe.scheduling.Executable;92 93 93 94 public class DCWormsStatistics implements SimulationStatistics { … … 149 150 protected HashMap<String, List<String>> task_processorsMap; 150 151 151 protected JobRegistry Impljr;152 protected JobRegistry jr; 152 153 153 154 … … 168 169 169 170 this.resourceController = resourceController; 170 jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER");171 jr = new JobRegistryImpl(""); 171 172 init(); 172 173 } … … 231 232 simulationStatsFile.close(); 232 233 } 233 234 } 235 236 234 } 237 235 238 236 /************* RESOURCE STATISTICS SECTION **************/ … … 241 239 242 240 //TEMPORARY CONFIGURATION SECTION 243 StandardResourceType [] resForAnalyze = {StandardResourceType.DataCenter, StandardResourceType.ComputingNode, StandardResourceType.Processor}; 244 HashMap<StandardResourceType, List<Stats>> type_stats = new HashMap<StandardResourceType, List<Stats>>(); 245 246 List<Stats> crStats = new ArrayList<Stats>(); 247 crStats.add(Stats.textLoad); 248 crStats.add(Stats.chartLoad); 249 crStats.add(Stats.textEnergy); 250 crStats.add(Stats.chartEnergy); 251 type_stats.put(StandardResourceType.DataCenter, crStats); 252 253 List<Stats> cnStats = new ArrayList<Stats>(); 254 cnStats.add(Stats.textLoad); 255 cnStats.add(Stats.chartLoad); 256 cnStats.add(Stats.textEnergy); 257 cnStats.add(Stats.chartEnergy); 258 type_stats.put(StandardResourceType.ComputingNode, cnStats); 259 260 List<Stats> cpuStats = new ArrayList<Stats>(); 261 cpuStats.add(Stats.textLoad); 262 cpuStats.add(Stats.chartLoad); 263 cpuStats.add(Stats.textEnergy); 264 //cpuStats.add(Stats.chartEnergy); 265 type_stats.put(StandardResourceType.Processor, cpuStats); 266 267 241 242 HashMap<String, List<Stats>> type_stats = new HashMap<String, List<Stats>>(); 243 244 for(String resourceName: resourceController.getComputingResourceLayers()){ 245 List<Stats> cStats = new ArrayList<Stats>(); 246 cStats.add(Stats.textLoad); 247 if(ArrayUtils.contains(configuration.resForUtilizationChart, resourceName)) 248 cStats.add(Stats.chartLoad); 249 cStats.add(Stats.textEnergy); 250 if(ArrayUtils.contains(configuration.resForEnergyChart, resourceName)) 251 cStats.add(Stats.chartEnergy); 252 type_stats.put(resourceName, cStats); 253 } 268 254 269 255 peGanttMap = new HashMap<String, TimetableEventSource>(); … … 305 291 } 306 292 307 for(St andardResourceType resType: resForAnalyze){293 for(String resourceName: resourceController.getComputingResourceLayers()){ 308 294 List<ComputingResource> resources = null; 309 295 try { 310 296 resources = new ArrayList<ComputingResource>(); 311 297 for(ComputingResource compRes: resourceController.getComputingResources() ){ 312 resources.addAll(compRes.getDescendantsByType( resType));313 } 314 /*if(resourceController.getComputingResources().get(0).getType().equals(resType))315 resources.addAll(resourceController.getComputingResources()); */298 resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName))); 299 } 300 if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName)) 301 resources.addAll(resourceController.getComputingResources()); 316 302 } catch (Exception e) { 317 303 continue; 318 304 } 319 if(type_stats.containsKey(res Type)){305 if(type_stats.containsKey(resourceName)){ 320 306 Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>(); 321 307 Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>(); … … 323 309 ResourceUsageStats resourceUsage = null; 324 310 ResourceEnergyStats energyUsage = null; 325 if(type_stats.get(res Type).contains(Stats.textLoad)){311 if(type_stats.get(resourceName).contains(Stats.textLoad)){ 326 312 resourceUsage = gatherResourceLoadStats(resource, basicResStats); 327 313 resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad)); … … 331 317 } 332 318 } 333 if(type_stats.get(res Type).contains(Stats.chartLoad)){319 if(type_stats.get(resourceName).contains(Stats.chartLoad)){ 334 320 if (configuration.creatediagrams_resources) { 335 321 createResourceLoadDiagram(resourceUsage); 336 322 } 337 323 } 338 if(type_stats.get(res Type).contains(Stats.textEnergy)){324 if(type_stats.get(resourceName).contains(Stats.textEnergy)){ 339 325 energyUsage = gatherResourceEnergyStats(resource); 340 326 energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage)); … … 352 338 boolean top = true; 353 339 while(parent != null){ 354 if(een != null && een.getPowerProfile() != null) 355 { 340 if(een != null && een.getPowerProfile() != null) { 356 341 top = false; 357 342 break; … … 368 353 } 369 354 } 370 if(type_stats.get(res Type).contains(Stats.chartEnergy)){355 if(type_stats.get(resourceName).contains(Stats.chartEnergy)){ 371 356 372 357 if (configuration.creatediagrams_energyusage) { … … 760 745 private JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName, 761 746 Title subtitle, String simulationTime) { 762 String energy = " ENERGY[W]";747 String energy = "POWER [W]"; 763 748 boolean urls = false; 764 749 boolean tooltip = true; -
DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java
r481 r490 1 1 package simulator.stats.implementation; 2 2 3 import gssim.schedframe.scheduling.Executable;4 3 5 4 import java.util.List; 5 6 import dcworms.schedframe.scheduling.Executable; 6 7 7 8 import simulator.stats.implementation.out.StatsSerializer;
Note: See TracChangeset
for help on using the changeset viewer.