Revision 1290,
938 bytes
checked in by wojtekp, 11 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Rev | Line | |
---|
[1290] | 1 | package example.load; |
---|
| 2 | |
---|
| 3 | import schedframe.resources.computing.ComputingResource; |
---|
| 4 | import schedframe.resources.computing.profiles.energy.EnergyEvent; |
---|
| 5 | import schedframe.resources.devices.PhysicalResource; |
---|
| 6 | import schedframe.scheduling.manager.tasks.JobRegistry; |
---|
| 7 | import simulator.stats.GSSAccumulator; |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | public class DefaultLoadEstimationPlugin extends BaseLoadEstimationPlugin{ |
---|
| 11 | |
---|
| 12 | public double estimateUtlization(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource) { |
---|
| 13 | |
---|
| 14 | ComputingResource computingResource = (ComputingResource) resource; |
---|
| 15 | GSSAccumulator childrenLoad = new GSSAccumulator(); |
---|
| 16 | for(ComputingResource compRes: computingResource.getChildren()){ |
---|
| 17 | childrenLoad.add(compRes.getLoadInterface().getRecentUtilization().getValue()); |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | //double backgroundLoad = resource.getLoadInterface().getLoadCalendar().getLoad(); |
---|
| 21 | //return childrenLoad.getMean() + backgroundLoad; |
---|
| 22 | return childrenLoad.getMean(); |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.