Changeset 1423 for DCWoRMS/branches
- Timestamp:
- 07/30/14 12:25:00 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src
- Files:
-
- 1 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/dcworms/schedframe/scheduling/Executable.java
r1415 r1423 51 51 52 52 protected int estimatedDuration; 53 protected String sched Name;53 protected String schedulerName; 54 54 55 55 protected double submissionTime; … … 157 157 } 158 158 159 public boolean isFinished() 160 { 159 public boolean isFinished(){ 161 160 return task.isFinished(); 162 161 } … … 264 263 265 264 public void setSchedulerName(int resourceId){ 266 this.sched Name = GridSim.getEntityName(resourceId);265 this.schedulerName = GridSim.getEntityName(resourceId); 267 266 } 268 267 269 268 public void setSchedulerName(String resourceId){ 270 this.sched Name = resourceId;269 this.schedulerName = resourceId; 271 270 } 272 271 273 272 public String getSchedulerName(){ 274 return sched Name;273 return schedulerName; 275 274 } 276 275 … … 375 374 376 375 private void preparePhases(String resourceType) { 377 LinkedList<ExecutionPhase> resourceConsumptionList= new LinkedList<ExecutionPhase>();376 LinkedList<ExecutionPhase> execPhases = new LinkedList<ExecutionPhase>(); 378 377 379 378 long usefulWork = -1; … … 388 387 e.printStackTrace(); 389 388 } 390 resourceConsumptionList.add(resConsumption);389 execPhases.add(resConsumption); 391 390 } else { 392 391 boolean found = false; … … 396 395 for(ResourceConsumptionType resConsumption: resConsumptioProfile.getResourceConsumption()){ 397 396 ExecutionPhase resourceConsumption = new ExecutionPhase(resConsumption); 398 resourceConsumptionList.add(resourceConsumption);397 execPhases.add(resourceConsumption); 399 398 } 400 399 for(StringParameterType prop: resConsumptioProfile.getProperties()){ … … 412 411 for(ResourceConsumptionType resConsumption: task.getDescription().getExecution().getResourceConsumptionProfile()[0].getResourceConsumption()){ 413 412 ExecutionPhase resourceConsumption = new ExecutionPhase(resConsumption); 414 resourceConsumptionList.add(resourceConsumption);413 execPhases.add(resourceConsumption); 415 414 } 416 415 … … 425 424 426 425 usefulWork = (usefulWork != -1) ? usefulWork : this.getLength(); 427 this.execProfile = new ExecutionProfile( resourceConsumptionList);426 this.execProfile = new ExecutionProfile(execPhases); 428 427 this.execProfile.setUsefulWork(usefulWork); 429 428 -
DCWoRMS/branches/coolemall/src/example/load/ProcessorLoadEstimationPlugin.java
r1415 r1423 1 1 package example.load; 2 2 3 import schedframe.resources.ResourceStatus; 4 import schedframe.resources.computing.Core; 3 5 import schedframe.resources.computing.Processor; 4 6 import schedframe.resources.computing.profiles.energy.ResourceEvent; 5 7 import schedframe.resources.devices.PhysicalResource; 6 8 import schedframe.scheduling.manager.tasks.JobRegistry; 7 import schedframe.scheduling.manager.tasks.JobRegistryImpl;8 import schedframe.scheduling.tasks.phases.PhaseSystemLoad;9 import dcworms.schedframe.scheduling.ExecTask;10 9 11 10 public class ProcessorLoadEstimationPlugin extends BaseLoadEstimationPlugin{ … … 14 13 Processor proc = (Processor) resource; 15 14 double sumCoresLoad = 0; 16 17 double nrOfThreadsOnCpu = proc.getCores().size(); 18 19 if(proc.getResourceCharacteristic().getParameters().get("threads") != null){ 20 nrOfThreadsOnCpu = nrOfThreadsOnCpu * Integer.valueOf(proc.getResourceCharacteristic().getParameters().get("threads").get(0).getContent()).intValue(); 15 if(proc.getStatus().equals(ResourceStatus.BUSY)){ 16 sumCoresLoad = 1; 17 } else { 18 if(proc.getCores().size() > 0){ 19 for(Core core: proc.getCores()){ 20 if(core.getStatus().equals(ResourceStatus.BUSY)){ 21 sumCoresLoad = sumCoresLoad + 1; 22 } 23 } 24 sumCoresLoad = sumCoresLoad / proc.getCores().size(); 25 } 21 26 } 22 23 24 JobRegistry jr = new JobRegistryImpl(proc.getFullName());25 for(ExecTask task: jr.getRunningTasks()){26 double cpuUsage = 1 / nrOfThreadsOnCpu;27 28 for(PhaseSystemLoad pb: task.getExecutionProfile().getCurrentResourceConsumption().getSystemLoad()){29 if(pb.getResouceName().equals("PM_CPU_Usage")){30 cpuUsage = pb.getUtilization();31 }32 }33 sumCoresLoad = sumCoresLoad + cpuUsage;34 35 }36 37 27 38 28 double processorLoad = 100 * sumCoresLoad; -
DCWoRMS/branches/coolemall/src/example/timeestimation/coolemall/PhaseBasedTimeEstimationPlugin.java
r1415 r1423 58 58 int cnt = peUnit.getUsedAmount(); 59 59 60 double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrent ResourceConsumption().getLenght() / (speed * cnt);60 double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrentExecutionPhase().getLenght() / (speed * cnt); 61 61 62 62 //double execTime = (1 - completionPercentage/100) * task.getExecutionProfile().getCurrentResourceConsumption().getDuration() * (taskFreq / currentFrequency); -
DCWoRMS/branches/coolemall/src/schedframe/Parameters.java
r477 r1423 10 10 private static final long serialVersionUID = 1L; 11 11 12 public Parameters(int initSize){ 13 super(initSize); 14 } 12 15 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceStatus.java
r477 r1423 4 4 BUSY, 5 5 FREE, 6 RESERVED,7 6 FAILED, 8 7 PENDING, -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
r1415 r1423 47 47 //protected ResourceCharacteristics resourceCharacteristic; 48 48 49 49 50 50 public ComputingResource(ComputingResourceDescription resDesc) { 51 51 this.type = resDesc.getType(); … … 53 53 this.category = resDesc.getCategory(); 54 54 this.status = ResourceStatus.FREE; 55 this.extensionList = new ExtensionListImpl( 1);55 this.extensionList = new ExtensionListImpl(2); 56 56 initCharacteristics(resDesc); 57 57 accept(new LoadExtension(resDesc.getLoadProfile(), this)); 58 58 accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build()); 59 59 60 } 60 61 61 62 protected void initCharacteristics(ComputingResourceDescription resDesc){ 62 resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build();63 this.resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build(); 63 64 for(Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()){ 64 65 device.setComputingResource(this); … … 71 72 72 73 public void setParent(ComputingResource newParent) { 73 parent = newParent;74 this.parent = newParent; 74 75 /*if(this.getLoadInterface().getLoadCalendar().getLoadDistribution().size() == 0){ 75 76 this.getLoadInterface().getLoadCalendar().getLoadDistribution().addAll(parent.getLoadInterface().getLoadCalendar().getLoadDistribution()); … … 79 80 public List<ComputingResource> getChildren() { 80 81 if (children == null) 81 return new ArrayList<ComputingResource>( 1);82 return new ArrayList<ComputingResource>(0); 82 83 return children; 83 84 } … … 124 125 ResourceEventCommand rec = new ResourceEventCommand(this); 125 126 rec.execute(event); 126 SchedulingEventCommand sec = new SchedulingEventCommand(this); 127 sec.execute(event); 128 127 if((scheduler != null && (parent != null && scheduler != parent.getScheduler())) && !event.getSource().equals(scheduler.getFullName())){ 128 SchedulingEventCommand sec = new SchedulingEventCommand(this); 129 sec.execute(event); 130 } 129 131 //old, correctly working method 130 132 /*if (extensionList != null) { … … 143 145 } 144 146 147 148 public void updateState(ResourceEvent event){ 149 for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 150 for (Extension extension: device.getExtensionList()) { 151 if (extension.supportsEvent(event)) { 152 extension.handleEvent(event); 153 } 154 } 155 } 156 157 if (extensionList != null) { 158 for (Extension extension: extensionList) { 159 if (extension.supportsEvent(event)) { 160 extension.handleEvent(event); 161 } 162 } 163 } 164 165 } 166 145 167 public List <? extends ComputingResource> getDescendantsByType(ResourceType type) { 146 List<ResourceValidator> validators = new ArrayList<ResourceValidator>( );168 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1); 147 169 validators.add(new ResourceTypeValidator(type)); 148 170 return searchDescendants(validators, true); … … 150 172 151 173 public List<? extends ComputingResource> getDescendantsByTypeAndStatus(ResourceType type, ResourceStatus status) { 152 List<ResourceValidator> validators = new ArrayList<ResourceValidator>( );174 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(2); 153 175 validators.add(new ResourceStatusValidator(status)); 154 176 validators.add(new ResourceTypeValidator(type)); … … 157 179 158 180 public ComputingResource getDescendantByName(String resourceName){ 159 List<ResourceValidator> validators = new ArrayList<ResourceValidator>( );181 List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1); 160 182 validators.add(new ResourceNameValidator(resourceName)); 161 183 List<? extends ComputingResource> resources = searchDescendants(validators, true); … … 227 249 228 250 public void handleResourceEvent(ResourceEvent event){ 251 for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) { 252 for (Extension extension: device.getExtensionList()) { 253 if (extension.supportsEvent(event)) { 254 extension.handleEvent(event); 255 } 256 } 257 } 258 229 259 if (extensionList != null) { 230 260 for (Extension extension: extensionList) { 231 261 if (extension.supportsEvent(event)) { 232 262 extension.handleEvent(event); 233 }234 }235 236 for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) {237 for (Extension extension: device.getExtensionList()) {238 if (extension.supportsEvent(event)) {239 extension.handleEvent(event);240 }241 263 } 242 264 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResourceCharacteristics.java
r1207 r1423 20 20 this.resUnits = builder.resUnits; 21 21 this.devices = builder.devices; 22 // TODO Auto-generated constructor stub23 22 } 24 23 25 24 public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() { 26 25 if(resUnits == null) 27 return new HashMap<ResourceUnitName, List<ResourceUnit>>( );26 return new HashMap<ResourceUnitName, List<ResourceUnit>>(2); 28 27 return resUnits; 29 28 } … … 54 53 public List<Device> getDevices(){ 55 54 if(devices == null) 56 return new ArrayList<Device>( );55 return new ArrayList<Device>(0); 57 56 return devices; 58 57 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java
r1207 r1423 30 30 public Parameters getParameters() { 31 31 if(parameters == null) 32 return new Parameters( );32 return new Parameters(2); 33 33 return parameters; 34 34 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java
r1344 r1423 112 112 public void addResourceUnit(ResourceUnit unit) { 113 113 if (this.resUnits == null) 114 this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>( 1);114 this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); 115 115 List<ResourceUnit> list = null; 116 116 if (this.resUnits.containsKey(unit.getName())) { -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
r1415 r1423 111 111 if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null) 112 112 return false; 113 if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 113 if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 114 return true; 115 else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 116 return true; 117 else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 118 return true; 119 else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 114 120 return true; 115 121 else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 116 122 return true; 117 else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 118 return true; 119 else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 120 return true; 121 else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 123 else if(event.getType().getName().equals(ResourceEventType.UPDATE_POWER_STATE.getName())) 122 124 return true; 123 125 … … 138 140 switch (resEvent.getType()) { 139 141 140 case UPDATE_POWER_STATE: 141 PowerStateName newPowerState = (PowerStateName) resEvent.getData(); 142 powerInterface.setPowerState(newPowerState); 143 break; 144 142 case UTILIZATION_CHANGED: 143 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 144 status = powerProfile.addToPowerUsageHistory(power); 145 break; 146 147 case TASK_STARTED: 148 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 149 status = powerProfile.addToPowerUsageHistory(power); 150 break; 151 152 case TASK_FINISHED: 153 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 154 status = powerProfile.addToPowerUsageHistory(power); 155 break; 156 145 157 case POWER_STATE_CHANGED: 146 158 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); … … 153 165 break; 154 166 155 case TASK_STARTED: 156 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 157 status = powerProfile.addToPowerUsageHistory(power); 158 break; 159 160 case TASK_FINISHED: 161 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 162 status = powerProfile.addToPowerUsageHistory(power); 163 break; 164 165 case UTILIZATION_CHANGED: 166 power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 167 status = powerProfile.addToPowerUsageHistory(power); 167 case UPDATE_POWER_STATE: 168 if(resource.getFullName().equals(resEvent.getSource())){ 169 PowerStateName newPowerState = (PowerStateName) resEvent.getData(); 170 powerInterface.setPowerState(newPowerState); 171 } 168 172 break; 169 173 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java
r1396 r1423 24 24 public AirflowValue getRecentAirflow(); 25 25 26 List<AirflowValue> getAirflowHistory();26 public List<AirflowValue> getAirflowHistory(); 27 27 28 28 public Parameters getParameters(); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java
r1415 r1423 1 1 package schedframe.resources.computing.profiles.energy.airthroughput.ui; 2 2 3 import java.util.ArrayList;4 3 import java.util.List; 5 4 … … 54 53 55 54 public List<AirflowState> getSupportedAirflowStates() { 56 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 57 for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 58 airflowStates.add(airflowState); 59 } 60 return airflowStates; 55 return airflowProfile.getAirflowStates(); 61 56 } 62 57 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
r1207 r1423 64 64 public List<PowerState> getSupportedPowerStates() { 65 65 if(supportedPowerStates == null) 66 return new ArrayList<PowerState>( );66 return new ArrayList<PowerState>(0); 67 67 return supportedPowerStates; 68 68 } … … 70 70 public Map<String, PState> getSupportedPStates() { 71 71 if(supportedPStates == null) 72 return new HashMap<String, PState>( );72 return new HashMap<String, PState>(0); 73 73 return supportedPStates; 74 74 } … … 117 117 boolean supportsOFF = false; 118 118 if(supportedPowerStates == null){ 119 supportedPowerStates = new ArrayList<PowerState>( );119 supportedPowerStates = new ArrayList<PowerState>(4); 120 120 } 121 121 for(PowerState ps: supportedPowerStates){ … … 128 128 129 129 if(!supportsON){ 130 supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, new ArrayList<Transition>())); 130 supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, null)); 131 supportedPowerStates.add(new PowerState(StandardPowerStateName.BOOT, -1, null)); 131 132 } 132 133 if(!supportsOFF){ 133 supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, new ArrayList<Transition>())); 134 supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, null)); 135 supportedPowerStates.add(new PowerState(StandardPowerStateName.POWEROFF, -1, null)); 134 136 } 135 137 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java
r477 r1423 1 1 package schedframe.resources.computing.profiles.energy.power; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 … … 24 25 } 25 26 public List<Transition> getTransitions() { 27 if(transitions == null) 28 return new ArrayList<Transition>(0); 26 29 return transitions; 27 30 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
r1415 r1423 1 1 package schedframe.resources.computing.profiles.energy.power.ui; 2 2 3 import java.util.ArrayList;4 3 import java.util.List; 5 4 … … 65 64 66 65 public List<PowerState> getSupportedPowerStates(){ 67 List<PowerState> powerStates = new ArrayList<PowerState>(); 68 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 69 powerStates.add(powerState); 70 } 71 return powerStates; 66 return powerProfile.getSupportedPowerStates(); 72 67 } 73 68 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java
r1415 r1423 4 4 5 5 import java.util.List; 6 6 7 7 8 import schedframe.resources.ResourceStatus; … … 37 38 } 38 39 39 if(state == StandardPowerStateName.OFF ){40 if(state == StandardPowerStateName.OFF || state == StandardPowerStateName.POWEROFF){ 40 41 node.setStatus(ResourceStatus.UNAVAILABLE); 41 42 } 42 else if(state == StandardPowerStateName.ON ){43 else if(state == StandardPowerStateName.ON || state == StandardPowerStateName.BOOT){ 43 44 node.setStatus(ResourceStatus.FREE); 44 45 } … … 55 56 /*double timePenalty = getTransitionTime(currentPowerState, StandardPowerStateName.ON); 56 57 setPowerState(StandardPowerStateName.BOOT); 57 DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName()));*/ 58 DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName())); 59 */ 58 60 setPowerState(StandardPowerStateName.ON); 59 61 } … … 68 70 private double getTransitionTime(PowerStateName from, PowerStateName to){ 69 71 List<PowerState> availablePowerStates = getSupportedPowerStates(); 70 double time Penalty= 0;72 double time = 0; 71 73 for(PowerState ps : availablePowerStates){ 72 74 if(ps.getName().getLabel().equals(from.getLabel())){ … … 74 76 for(Transition t: transitions){ 75 77 if(t.getTo().getLabel().equals(to)){ 76 time Penalty= t.getTime();78 time = t.getTime(); 77 79 } 78 80 } 79 81 } 80 82 } 81 return time Penalty;83 return time; 82 84 } 83 85 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java
r1380 r1423 24 24 //public double getCurrentPowerConsumption(); 25 25 26 List<PowerUsage> getPowerUsageHistory();26 public List<PowerUsage> getPowerUsageHistory(); 27 27 28 28 public Parameters getParameters(); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ui/ThermalInterface.java
r804 r1423 10 10 public TemperatureValue getRecentTemperature(); 11 11 12 List<TemperatureValue> getTemperatureHistory();12 public List<TemperatureValue> getTemperatureHistory(); 13 13 14 14 public Parameters getParameters(); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadEstimationPluginFactory.java
r1293 r1423 1 1 package schedframe.resources.computing.profiles.load; 2 2 3 import example.load.AppBasedProcessorLoadEstimationPlugin; 3 4 import example.load.DefaultLoadEstimationPlugin; 4 5 import example.load.ProcessorLoadEstimationPlugin; … … 14 15 15 16 if(resType.getName().equals(StandardResourceType.Processor.getName())) 16 loadEstimationPlugin = new ProcessorLoadEstimationPlugin();17 loadEstimationPlugin = new AppBasedProcessorLoadEstimationPlugin(); 17 18 else 18 19 loadEstimationPlugin = new DefaultLoadEstimationPlugin(); -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java
r1415 r1423 19 19 protected PhysicalResource resource; 20 20 21 public LoadExtension(LoadProfile loadProfile, 21 public LoadExtension(LoadProfile loadProfile, PhysicalResource resource) { 22 22 this.loadProfile = loadProfile; 23 23 this.loadInterface = LoadInterfaceFactory.createLoadInterface(resource, loadProfile); … … 29 29 if(loadProfile == null || loadProfile.getLoadEstimationPlugin() == null) 30 30 return false; 31 if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 32 return true; 33 else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 31 if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 34 32 return true; 35 33 else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) … … 37 35 else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 38 36 return true; 39 else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName())) 40 return true; 37 else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName())) 38 return true; 39 else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName())) 40 return true; 41 41 else return false; 42 42 } … … 44 44 public void handleEvent(Event event) { 45 45 46 ResourceEvent enEvent = (ResourceEvent)event;46 ResourceEvent resEvent = (ResourceEvent)event; 47 47 double load = 0; 48 48 try{ 49 switch ( enEvent.getType()) {49 switch (resEvent.getType()) { 50 50 51 case UTILIZATION_CHANGED: 52 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 53 loadProfile.addToLoadHistory(load); 54 break; 55 56 case TASK_STARTED: 57 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 58 loadProfile.addToLoadHistory(load); 59 break; 60 61 case TASK_FINISHED: 62 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 63 loadProfile.addToLoadHistory(load); 64 break; 65 51 66 case POWER_STATE_CHANGED: 52 load = loadProfile.getLoadEstimationPlugin().estimateUtlization( enEvent, new JobRegistryImpl(resource.getFullName()), resource);67 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 53 68 loadProfile.addToLoadHistory(load); 54 69 break; 55 70 56 71 case CPU_FREQUENCY_CHANGED: 57 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 58 loadProfile.addToLoadHistory(load); 59 break; 60 61 case TASK_STARTED: 62 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 63 loadProfile.addToLoadHistory(load); 64 break; 65 66 case TASK_FINISHED: 67 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 68 loadProfile.addToLoadHistory(load); 69 break; 70 71 case UTILIZATION_CHANGED: 72 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 72 load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource); 73 73 loadProfile.addToLoadHistory(load); 74 74 break; -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java
r1415 r1423 1 1 package schedframe.resources.devices; 2 2 3 import java.util.ArrayList;4 3 import java.util.List; 5 4 … … 54 53 55 54 public List<AirflowState> getSupportedAirflowStates(){ 56 List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 57 for(AirflowState airFlowState: airflowProfile.getAirflowStates()){ 58 airflowStates.add(airFlowState); 59 } 60 return airflowStates; 55 return airflowProfile.getAirflowStates(); 61 56 } 62 57 -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceResourceCharacteristics.java
r1207 r1423 10 10 } 11 11 12 13 12 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java
r1415 r1423 2 2 3 3 import schedframe.Initializable; 4 import schedframe.events.Event;5 4 import schedframe.events.EventHandler; 6 5 import schedframe.resources.Resource; … … 10 9 import schedframe.resources.computing.extensions.Extension; 11 10 import schedframe.resources.computing.extensions.ExtensionList; 11 import schedframe.resources.computing.extensions.ExtensionListImpl; 12 12 import schedframe.resources.computing.extensions.ExtensionType; 13 13 import schedframe.resources.computing.profiles.energy.EnergyExtension; … … 99 99 100 100 public ExtensionList getExtensionList() { 101 if(extensionList == null){ 102 return new ExtensionListImpl(0); 103 } 101 104 return extensionList; 102 105 } -
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
r1415 r1423 91 91 92 92 if(params == null) 93 params = new Parameters( );93 params = new Parameters(2); 94 94 params.put("powerCapLevel", param); 95 95 } … … 102 102 103 103 if(params == null) 104 params = new Parameters( );104 params = new Parameters(2); 105 105 params.put("powerFloorLevel", param); 106 106 } … … 273 273 274 274 if(parameters.length != 0) 275 params = new Parameters( );275 params = new Parameters(2); 276 276 277 277 for(int i = 0; i < parameters.length; i++){ -
DCWoRMS/branches/coolemall/src/schedframe/resources/units/ProcessingElements.java
r1392 r1423 239 239 240 240 public ProcessingElements replicate(int amount){ 241 List<ComputingResource> compResources = 241 List<ComputingResource> compResources = new ArrayList<ComputingResource>(amount); 242 242 Iterator<ComputingResource> it = resources.iterator(); 243 243 amount = Math.min(resources.size(), amount); -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/ExecutionHistoryItem.java
r1362 r1423 5 5 public class ExecutionHistoryItem { 6 6 7 protected DateTimetimeStamp;7 protected long timeStamp; 8 8 protected double completionPercentage; 9 9 protected double estimatedDuration; … … 11 11 protected int resUsageIndex; 12 12 13 public ExecutionHistoryItem( DateTimetime){13 public ExecutionHistoryItem(long time){ 14 14 this.timeStamp = time; 15 15 } 16 16 17 public DateTimegetTimeStamp(){17 public long getTimeStamp(){ 18 18 return timeStamp; 19 19 } -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java
r1415 r1423 1 1 package schedframe.scheduling; 2 2 3 import java.util.HashSet; 3 4 import java.util.LinkedList; 4 5 import java.util.List; 5 6 import java.util.Map; 6 7 import java.util.Set; 7 import java.util.TreeSet;8 8 9 9 import schedframe.resources.computing.ComputingResource; … … 20 20 public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){ 21 21 this.usedResources = usedResources; 22 this.resourceNames = new TreeSet<String>(); 23 saveResourceNames(); 22 this.resourceNames = saveResourceNames(); 24 23 } 25 24 … … 32 31 } 33 32 34 private void saveResourceNames(){ 33 private Set<String> saveResourceNames(){ 34 Set<String> resourceNames; 35 35 ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE); 36 for (ComputingResource resource : pes) { 36 resourceNames = new HashSet<String>(pes.size(), 1); 37 for (ComputingResource resource: pes) { 37 38 38 39 LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>(); … … 54 55 } 55 56 } 57 return resourceNames; 56 58 } 57 59 } -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
r1415 r1423 4 4 import java.util.HashMap; 5 5 import java.util.Iterator; 6 import java.util.LinkedHashSet; 6 7 import java.util.List; 7 8 import java.util.Map; 9 import java.util.Set; 8 10 9 11 import org.apache.commons.logging.Log; … … 93 95 94 96 int tag = ev.get_tag(); 95 96 97 switch (tag) { 97 98 … … 139 140 getWorkloadUnitHandler().handleJob(job); 140 141 } 141 //SUPPORTS PRECEDING CONSTRAINST COMING BOTHFROM SWF FILES142 //SUPPORTS PRECEDING CONSTRAINST COMING ALSO FROM SWF FILES 142 143 /*else { 143 144 try { … … 394 395 PEUnit peUnit = (PEUnit)resources.get(StandardResourceUnitName.PE); 395 396 updateComputingResources(peUnit, ResourceEventType.TASK_STARTED, exec); 396 397 } 397 } 398 398 399 protected void finalizeExecutable(ExecTask execTask){ 399 400 … … 459 460 //System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " + execHistItem.getCompletionPercentage()); 460 461 exec.getExecutionProfile().setCompletionPercentage(exec.getExecutionProfile().getCompletionPercentage() + 100 * (timeSpan / (execHistItem.getEstimatedDuration()) * (1.0 - execHistItem.getCompletionPercentage()/100.0))); 461 exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrent ResourceConsumption().getLenght() / exec.getExecutionProfile().getLength());462 exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrentExecutionPhase().getLenght() / exec.getExecutionProfile().getLength()); 462 463 //System.out.println("newProgress: " + exec.getCompletionPercentage() ); 463 464 … … 467 468 private void updateComputingResources(PEUnit peUnit, ResourceEventType eventType, Object obj){ 468 469 if(peUnit instanceof ProcessingElements){ 469 ProcessingElements pes = (ProcessingElements) peUnit;470 /*ProcessingElements pes = (ProcessingElements) peUnit; 470 471 for (ComputingResource resource : pes) { 471 472 resource.handleEvent(new ResourceEvent(eventType, obj, scheduler.getFullName())); 472 473 //DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(eventType, obj)); 473 } 474 }*/ 474 475 /*try { 475 476 for (ComputingResource resource : resourceManager.getResourcesOfType(pes.get(0).getType())) { … … 480 481 e.printStackTrace(); 481 482 }*/ 483 484 ProcessingElements pes = (ProcessingElements) peUnit; 485 ResourceEvent resEvent = new ResourceEvent(eventType, obj, scheduler.getFullName()); 486 try{ 487 Set<ComputingResource> resourcesToUpdate = new LinkedHashSet<ComputingResource>(); 488 489 for (ComputingResource compResource : pes) { 490 resourcesToUpdate.add(compResource); 491 } 492 while(resourcesToUpdate.size() > 0){ 493 Set<ComputingResource> newSet = new LinkedHashSet<ComputingResource>(); 494 for(ComputingResource compResource: resourcesToUpdate){ 495 compResource.updateState(resEvent); 496 if(compResource.getParent() != null){ 497 newSet.add(compResource.getParent()); 498 } 499 } 500 resourcesToUpdate = new LinkedHashSet<ComputingResource>(newSet); 501 } 502 }catch(Exception e){ 503 } 482 504 } else { 483 505 ComputingResource resource = null; … … 492 514 493 515 protected void updateProcessingTimes() { 494 for (ExecTask execTask 516 for (ExecTask execTask: jobRegistry.getRunningTasks()) { 495 517 Executable exec = (Executable)execTask; 496 518 … … 502 524 503 525 ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 504 double lastTimeStamp = execHistItem.getTimeStamp() .getMillis()/ 1000;526 double lastTimeStamp = execHistItem.getTimeStamp() / 1000; 505 527 if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis() / 1000 + phaseDuration)) == 0.0){ 506 528 continue; … … 706 728 707 729 private void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){ 708 ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime() );730 ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime().getMillis()); 709 731 execHistoryItem.setCompletionPercentage(completionPercentage); 710 732 execHistoryItem.setEstimatedDuration(estimatedDuration); -
DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java
r1415 r1423 5 5 public class ExecutionProfile { 6 6 7 protected LinkedList<ExecutionPhase> resourceConsumptionList;7 protected LinkedList<ExecutionPhase> executionPhases; 8 8 protected long usefulWork; 9 9 protected double completionPercentage; … … 11 11 12 12 13 public ExecutionProfile(LinkedList<ExecutionPhase> resourceConsumptionList) {14 this. resourceConsumptionList = resourceConsumptionList;13 public ExecutionProfile(LinkedList<ExecutionPhase> execPhases) { 14 this.executionPhases = execPhases; 15 15 this.completionPercentage = 0; 16 16 this.currentPhase = 0; 17 17 } 18 18 19 public LinkedList<ExecutionPhase> get ResourceConsumptionList(){20 return resourceConsumptionList;19 public LinkedList<ExecutionPhase> getExecutionPhases(){ 20 return executionPhases; 21 21 } 22 22 23 public ExecutionPhase getCurrent ResourceConsumption(){24 return resourceConsumptionList.get(currentPhase);23 public ExecutionPhase getCurrentExecutionPhase(){ 24 return executionPhases.get(currentPhase); 25 25 } 26 26 … … 42 42 43 43 public boolean isLast(){ 44 if(currentPhase == resourceConsumptionList.size() - 1){44 if(currentPhase == executionPhases.size() - 1){ 45 45 return true; 46 46 } … … 58 58 public long getLength() { 59 59 long length = 0; 60 for(ExecutionPhase execPhase: resourceConsumptionList){60 for(ExecutionPhase execPhase: executionPhases){ 61 61 length = length + execPhase.getLenght(); 62 62 } -
DCWoRMS/branches/coolemall/src/simulator/ConfigurationOptions.java
r1396 r1423 77 77 78 78 79 public static final String CREATESTATISTICS = "createstatistics"; 80 public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources"; 81 public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks"; 82 public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs"; 83 public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation"; 84 79 public static final String CREATEXTSTATISTICS = "creatextatistics"; 80 public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATEXTSTATISTICS + ".accumulatedresources"; 81 public static final String EXTENDED_TASKS_STATISTICS = CREATEXTSTATISTICS + ".extendedtasks"; 82 public static final String JOBS_STATISTICS = CREATEXTSTATISTICS + ".jobs"; 83 public static final String SIMULATION_STATISTICS = CREATEXTSTATISTICS + ".simulation"; 84 public static final String SIMULATION_UTILIZATION = CREATEXTSTATISTICS + ".resutilization"; 85 public static final String SIMULATION_ENERGYUSAGE = CREATEXTSTATISTICS + ".respowerusage"; 86 public static final String SIMULATION_AIRFLOW = CREATEXTSTATISTICS + ".resairflow"; 87 public static final String SIMULATION_TEMPERATURE = CREATEXTSTATISTICS + ".restemperature"; 88 89 85 90 public static final String PRESSURE_DROP = "pressuredrop"; 86 91 public static final String OUTLET_ROOM_AIR_TEMPERATURE = "outletroomairtemperature"; … … 186 191 public boolean createsimulationstatistics = true; 187 192 188 public String [] resForEnergyChart; 189 public String [] resForAirflowChart; 190 public String [] resForTemperatureChart; 191 public String [] resForUtilizationChart; 193 public String [] compResForEnergyChart; 194 public String [] compResForAirflowChart; 195 public String [] compResForTemperatureChart; 196 public String [] compResForUtilizationChart; 197 198 public String [] compResForEnergyText; 199 public String [] compResForAirflowText; 200 public String [] compResForTemperatureText; 201 public String [] compResForUtilizationText; 192 202 193 203 public double pressureDrop; … … 311 321 312 322 try { 313 co. resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";");314 if(co. resForUtilizationChart.length > 0){323 co.compResForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";"); 324 if(co.compResForUtilizationChart.length > 0){ 315 325 co.creatediagrams_resutilization = true; 316 326 } … … 325 335 } 326 336 try { 327 co. resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";");328 if(co. resForEnergyChart.length > 0){337 co.compResForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";"); 338 if(co.compResForEnergyChart.length > 0){ 329 339 co.creatediagrams_respowerusage = true; 330 340 } … … 334 344 335 345 try { 336 co. resForAirflowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";");337 if(co. resForAirflowChart.length > 0){346 co.compResForAirflowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";"); 347 if(co.compResForAirflowChart.length > 0){ 338 348 co.creatediagrams_resairflow = true; 339 349 } … … 343 353 344 354 try { 345 co. resForTemperatureChart = bundle.getString(CREATEDIAGRAMS_TEMPERATURE).split(";");346 if(co. resForTemperatureChart.length > 0){355 co.compResForTemperatureChart = bundle.getString(CREATEDIAGRAMS_TEMPERATURE).split(";"); 356 if(co.compResForTemperatureChart.length > 0){ 347 357 co.creatediagrams_restemperature = true; 348 358 } 349 359 } catch(MissingResourceException e){ 350 360 co.creatediagrams_restemperature = createDiagrams; 361 } 362 363 try { 364 co.compResForUtilizationText = bundle.getString(SIMULATION_UTILIZATION).split(";"); 365 } catch(MissingResourceException e){ 366 } 367 368 try { 369 co.compResForEnergyText = bundle.getString(SIMULATION_ENERGYUSAGE).split(";"); 370 } catch(MissingResourceException e){ 371 } 372 373 try { 374 co.compResForAirflowText = bundle.getString(SIMULATION_AIRFLOW).split(";"); 375 } catch(MissingResourceException e){ 376 } 377 378 try { 379 co.compResForTemperatureText = bundle.getString(SIMULATION_TEMPERATURE).split(";"); 380 } catch(MissingResourceException e){ 351 381 } 352 382 -
DCWoRMS/branches/coolemall/src/simulator/reader/EnvironmentWrapper.java
r1207 r1423 95 95 96 96 if(parameters.length != 0) 97 params = new Parameters( );97 params = new Parameters(2); 98 98 99 99 for(int i = 0; i < parameters.length; i++){ -
DCWoRMS/branches/coolemall/src/simulator/reader/ResourceReader.java
r1396 r1423 326 326 327 327 if(params == null) 328 params = new Parameters( );328 params = new Parameters(2); 329 329 params.put("frequency", param); 330 330 } -
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
r1396 r1423 289 289 for(String resourceTypeName: resourceController.getComputingResourceLayers()){ 290 290 List<Stats> cStats = new ArrayList<Stats>(); 291 /*if(ArrayUtils.contains(configuration.compResForUtilizationText, resourceTypeName)) 292 cStats.add(Stats.textLoad); 293 if(ArrayUtils.contains(configuration.compResForEnergyText, resourceTypeName)) 294 cStats.add(Stats.textEnergy); 295 if(ArrayUtils.contains(configuration.compResForAirflowText, resourceTypeName)) 296 cStats.add(Stats.textAirFlow); 297 if(ArrayUtils.contains(configuration.compResForTemperatureText, resourceTypeName)) 298 cStats.add(Stats.textTemperature);*/ 291 299 cStats.add(Stats.textLoad); 292 if(ArrayUtils.contains(configuration. resForUtilizationChart, resourceTypeName))300 if(ArrayUtils.contains(configuration.compResForUtilizationChart, resourceTypeName)) 293 301 cStats.add(Stats.chartLoad); 294 302 cStats.add(Stats.textEnergy); 295 if(ArrayUtils.contains(configuration. resForEnergyChart, resourceTypeName))303 if(ArrayUtils.contains(configuration.compResForEnergyChart, resourceTypeName)) 296 304 cStats.add(Stats.chartEnergy); 297 305 cStats.add(Stats.textAirFlow); 298 if(ArrayUtils.contains(configuration. resForAirflowChart, resourceTypeName))306 if(ArrayUtils.contains(configuration.compResForAirflowChart, resourceTypeName)) 299 307 cStats.add(Stats.chartAirFlow); 300 308 cStats.add(Stats.textTemperature); 301 if(ArrayUtils.contains(configuration. resForTemperatureChart, resourceTypeName))309 if(ArrayUtils.contains(configuration.compResForTemperatureChart, resourceTypeName)) 302 310 cStats.add(Stats.chartTemperature); 303 311 type_stats.put(resourceTypeName, cStats); 304 312 305 313 } 306 307 peGanttMap = new HashMap<String, TimetableEventSource>(); 308 taskGanttMap = new HashMap<String, TimetableEventGroup>(); 309 310 resourceOccupancyDiagrams = new HashMap<String, List<XYDataset>>(); 311 resourceUtilizationDiagrams = new HashMap<String, List<XYDataset>>(); 312 resourcePowerUsageDiagrams = new HashMap<String, List<XYDataset>>(); 313 resourceAirFlowDiagrams = new HashMap<String, List<XYDataset>>(); 314 resourceTemperatureDiagrams = new HashMap<String, List<XYDataset>>(); 314 315 resourceOccupancyDiagrams = new HashMap<String, List<XYDataset>>(2); 316 resourceUtilizationDiagrams = new HashMap<String, List<XYDataset>>(2); 317 resourcePowerUsageDiagrams = new HashMap<String, List<XYDataset>>(2); 318 resourceAirFlowDiagrams = new HashMap<String, List<XYDataset>>(2); 319 resourceTemperatureDiagrams = new HashMap<String, List<XYDataset>>(2); 315 320 316 321 ganttDiagramTimetable = new Timetable(new FixedMillisecond( … … 536 541 } 537 542 538 if(ArrayUtils.contains(configuration. resForEnergyChart, device.getType().getName())){543 if(ArrayUtils.contains(configuration.compResForEnergyChart, device.getType().getName())){ 539 544 if (configuration.creatediagrams_respowerusage) { 540 545 createResourceEnergyDiagramData(deviceEnergyUsage); … … 590 595 } 591 596 592 if(ArrayUtils.contains(configuration. resForAirflowChart, device.getType().getName())){597 if(ArrayUtils.contains(configuration.compResForAirflowChart, device.getType().getName())){ 593 598 if (configuration.creatediagrams_resairflow) { 594 599 createResourceAirFlowDiagramData(deviceAirFlow); … … 645 650 } 646 651 647 if(ArrayUtils.contains(configuration. resForTemperatureChart, device.getType().getName())){652 if(ArrayUtils.contains(configuration.compResForTemperatureChart, device.getType().getName())){ 648 653 if (configuration.creatediagrams_restemperature) { 649 654 createResourceTemperatureDiagramData(deviceTemperature); … … 847 852 } 848 853 if(st == -1){ 849 st = execHistItem.getTimeStamp() .getMillis();854 st = execHistItem.getTimeStamp(); 850 855 } 851 856 852 857 if(j < execHistory.size() - 1 && (execHistory.get(j + 1).getResIndex() != execHistItem.getResIndex() || execHistory.get(j + 1).getStatus() == DCWormsTags.PAUSED) || j + 1 == execHistory.size()){ 853 858 if(j < execHistory.size() -1 && (execHistory.get(j + 1).getResIndex() != execHistItem.getResIndex() || execHistory.get(j + 1).getStatus() == DCWormsTags.PAUSED)) 854 et = execHistory.get(j + 1).getTimeStamp() .getMillis();859 et = execHistory.get(j + 1).getTimeStamp(); 855 860 else et = Double.valueOf(exec.getFinishTime()).longValue() * MILLI_SEC; 856 861 if(resUnit instanceof ProcessingElements){ … … 922 927 for(ExecutionHistoryItem execHistItem: execTask.getExecutionHistory()){ 923 928 if(previousStatus == DCWormsTags.INEXEC){ 924 executionTime = executionTime + (execHistItem.getTimeStamp() .getMillis()/1000 - previousTimestamp);929 executionTime = executionTime + (execHistItem.getTimeStamp()/1000 - previousTimestamp); 925 930 } 926 previousTimestamp = execHistItem.getTimeStamp() .getMillis()/1000;931 previousTimestamp = execHistItem.getTimeStamp()/1000; 927 932 previousStatus = execHistItem.getStatus(); 928 933 } … … 1520 1525 1521 1526 private void createPEGanttDiagram(Map<String,List<ResStat>> basicResStats) { 1527 peGanttMap = new HashMap<String, TimetableEventSource>(); 1528 taskGanttMap = new HashMap<String, TimetableEventGroup>(); 1522 1529 for(String peName: basicResStats.keySet()){ 1523 1530 TimetableEventSource pe = new TimetableEventSource(peName); -
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/TaskStats.java
r1396 r1423 110 110 for(ExecutionHistoryItem execHistItem: task.getExecutionHistory()){ 111 111 if(previousStatus == DCWormsTags.INEXEC){ 112 executionTime = executionTime + (execHistItem.getTimeStamp() .getMillis()/1000 - previousTimestamp);112 executionTime = executionTime + (execHistItem.getTimeStamp()/1000 - previousTimestamp); 113 113 } 114 previousTimestamp = execHistItem.getTimeStamp() .getMillis()/1000;114 previousTimestamp = execHistItem.getTimeStamp()/1000; 115 115 previousStatus = execHistItem.getStatus(); 116 116 }
Note: See TracChangeset
for help on using the changeset viewer.