From 4e9f72b50473d73f9ca9e30a7fbeb97a8a1c0555 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 7 Apr 2021 16:26:00 +0200 Subject: 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. --- .../src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'simulator/opendc-compute') 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) } } ) -- cgit v1.2.3