diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-18 21:54:09 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-24 11:48:43 +0200 |
| commit | 709cd4909ccc1305c7acfdf666156168d66646eb (patch) | |
| tree | a9c95f0f0c320943dda287c4d8c96c7fb4336471 /opendc-simulator/opendc-simulator-compute/src/main | |
| parent | 97a28129e4638f601864a08f483908907b9026e6 (diff) | |
feat(simulator): Add support for reporting interfered work
This change adds support to the simulator for reporting the work lost
due to performance interference.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/main')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt index 17130d34..c31b1f6b 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt @@ -67,6 +67,7 @@ public class SimFairShareHypervisor( private var lastDemand = 0.0 private var lastActual = 0.0 private var lastOvercommit = 0.0 + private var lastInterference = 0.0 private var lastReport = Long.MIN_VALUE override fun onConverge(timestamp: Long) { @@ -79,7 +80,7 @@ public class SimFairShareHypervisor( (counters.demand - lastDemand).toLong(), (counters.actual - lastActual).toLong(), (counters.overcommit - lastOvercommit).toLong(), - 0L, + (counters.interference - lastInterference).toLong(), lastCpuUsage, lastCpuDemand ) @@ -91,6 +92,7 @@ public class SimFairShareHypervisor( lastDemand = counters.demand lastActual = counters.actual lastOvercommit = counters.overcommit + lastInterference = counters.interference val load = lastCpuDemand / ctx.cpus.sumOf { it.model.frequency } triggerGovernors(load) |
