Ignore:
Timestamp:
02/26/13 08:41:50 (12 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/example/energy/CPUEnergyEstimationPlugin.java

    r580 r883  
    1717                        powerConsumption = 0; 
    1818                else { 
    19                         try { 
    20                                 if(resource.getStatus() == ResourceStatus.BUSY) 
     19                        if(resource.getStatus() == ResourceStatus.BUSY){ 
     20                                try { 
     21 
    2122                                        powerConsumption = cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPState()); 
    22                                 else { 
    23                                         powerConsumption = cpu.getPowerInterface().getPowerConsumption(StandardPowerStateName.ON); 
     23                                } catch (NoSuchFieldException e) { 
     24                                        try { 
     25                                                powerConsumption = cpu.getPowerInterface().getPowerConsumption(StandardPowerStateName.ON); 
     26                                        } catch (NoSuchFieldException e1) { 
     27                                                powerConsumption = 10; 
     28                                        } 
    2429                                } 
    25                         } catch (NoSuchFieldException e) { 
     30                        } else{ 
    2631                                try { 
    27                                         powerConsumption = cpu.getPowerInterface().getPowerConsumption(StandardPowerStateName.ON); 
    28                                 } catch (NoSuchFieldException e1) { 
    29                                         powerConsumption = 10; 
     32                                        powerConsumption = cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPState()); 
     33                                } catch (NoSuchFieldException e) { 
     34                                        try { 
     35                                                powerConsumption = cpu.getPowerInterface().getPowerConsumption(StandardPowerStateName.ON); 
     36                                        } catch (NoSuchFieldException e1) { 
     37                                                powerConsumption = 0; 
     38                                        } 
    3039                                } 
    3140                        } 
     41                         
    3242                } 
    3343                return powerConsumption; 
Note: See TracChangeset for help on using the changeset viewer.