summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-07 16:26:00 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-07 20:38:46 +0200
commit4e9f72b50473d73f9ca9e30a7fbeb97a8a1c0555 (patch)
tree6d4855c6a93cfc41064e73b169e2f39d5530a5ae /simulator/opendc-compute
parent95a0ed6911f136fb25bb76d6b6e010bf66b8ba5b (diff)
simulator: Move away from StateFlow for low-level monitoring
This change removes the StateFlow speed property on the SimResourceSource, as the overhead of emitting changes to the StateFlow is too high in a single-thread context. Our new approach is to use direct callbacks and counters.
Diffstat (limited to 'simulator/opendc-compute')
-rw-r--r--simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
index 8e1aab44..89d01c57 100644
--- a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
+++ b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
@@ -104,7 +104,7 @@ public class SimHost(
_cpuWorkInterference.record(interferedWork.toDouble())
_cpuUsage.record(cpuUsage)
_cpuDemand.record(cpuDemand)
- _cpuPower.record(machine.powerDraw.value)
+ _cpuPower.record(machine.powerDraw)
}
}
)