- Timestamp:
- 07/30/14 12:25:00 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.