Ignore:
Timestamp:
07/30/14 12:25:00 (11 years ago)
Author:
wojtekp
Message:
 
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  
    11package schedframe.resources.computing.profiles.load; 
    22 
     3import example.load.AppBasedProcessorLoadEstimationPlugin; 
    34import example.load.DefaultLoadEstimationPlugin; 
    45import example.load.ProcessorLoadEstimationPlugin; 
     
    1415                 
    1516                if(resType.getName().equals(StandardResourceType.Processor.getName())) 
    16                         loadEstimationPlugin = new ProcessorLoadEstimationPlugin(); 
     17                        loadEstimationPlugin = new AppBasedProcessorLoadEstimationPlugin(); 
    1718                else 
    1819                        loadEstimationPlugin = new DefaultLoadEstimationPlugin(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java

    r1415 r1423  
    1919        protected PhysicalResource resource; 
    2020 
    21         public LoadExtension(LoadProfile loadProfile,  PhysicalResource resource) { 
     21        public LoadExtension(LoadProfile loadProfile, PhysicalResource resource) { 
    2222                this.loadProfile = loadProfile; 
    2323                this.loadInterface =  LoadInterfaceFactory.createLoadInterface(resource, loadProfile); 
     
    2929                if(loadProfile == null || loadProfile.getLoadEstimationPlugin() == null) 
    3030                        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())) 
    3432                        return true; 
    3533                else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName())) 
     
    3735                else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName())) 
    3836                        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; 
    4141                else return false; 
    4242        } 
     
    4444        public void handleEvent(Event event) { 
    4545                 
    46                 ResourceEvent enEvent = (ResourceEvent)event; 
     46                ResourceEvent resEvent = (ResourceEvent)event; 
    4747                double load = 0; 
    4848                try{ 
    49                         switch (enEvent.getType()) { 
     49                        switch (resEvent.getType()) { 
    5050                         
     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                                 
    5166                        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); 
    5368                                loadProfile.addToLoadHistory(load); 
    5469                                break; 
    5570                                 
    5671                        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); 
    7373                                loadProfile.addToLoadHistory(load); 
    7474                                break; 
Note: See TracChangeset for help on using the changeset viewer.