diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-25 20:46:36 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-25 20:50:43 +0200 |
| commit | b0f6402f60ddbba1aad7e198fe6757792337f4d4 (patch) | |
| tree | 276eddd32297cf370ca37504ac0ef770f55ec4fe /opendc-simulator | |
| parent | 8f58ae2b28518c6a2ed2fe3657984f417b3d3ddb (diff) | |
refactor(compute): Measure power draw without PSU overhead
This change updates the SimHost implementation to measure the power draw
of the machine without PSU overhead to make the results more realistic.
Diffstat (limited to 'opendc-simulator')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt index 2c711945..639ca450 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt @@ -49,6 +49,12 @@ public class SimBareMetalMachine( parent: SimResourceSystem? = null, ) : SimAbstractMachine(interpreter, parent, model) { /** + * The power draw of the machine onto the PSU. + */ + public val powerDraw: Double + get() = powerDriverLogic.computePower() + + /** * The processing units of the machine. */ override val cpus: List<SimProcessingUnit> = model.cpus.map { cpu -> |
