summaryrefslogtreecommitdiff
path: root/simulator/opendc-experiments/opendc-experiments-capelin/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-07 21:59:13 +0200
committerGitHub <noreply@github.com>2021-04-07 21:59:13 +0200
commit5d3b759b18fb0a4278b43dea6a9db478b07804a5 (patch)
tree419dedda10f6a1f1865fbee4d1f546dd8876c940 /simulator/opendc-experiments/opendc-experiments-capelin/src/test
parent519141f9af525a853b40eb821e70ca209bc104bf (diff)
parent3d707674ddfa96ae5c090a7c918350b0bef9b50f (diff)
simulator: Optimize bottlenecks in resource layer
This pull request addresses several bottlenecks that were present in the `opendc-simulator-resources` layer and `TimerScheduler`. These changes result into a 4x performance improvement for the energy experiments we are currently doing. * The use of `StateFlow` has been removed where possible. Profiling shows that emitting changes to `StateFlow` becomes a bottleneck in a single-thread context. * `SimSpeedConsumerAdapter` is an alternative for obtaining the changes in speed of a resource. **Breaking API Changes** * `SimResourceSource` does not expose `speed` as `StateFlow` anymore. To monitor speed changes, use `SimSpeedConsumerAdapter`. * Power draw in `SimBareMetalMachine` is not exposed as `StateFlow` anymore.
Diffstat (limited to 'simulator/opendc-experiments/opendc-experiments-capelin/src/test')
-rw-r--r--simulator/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/simulator/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt b/simulator/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
index 02cfdc06..0441cfed 100644
--- a/simulator/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
+++ b/simulator/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt
@@ -119,7 +119,7 @@ class CapelinIntegrationTest {
{ assertEquals(0, monitorResults.unscheduledVms, "No VM should not be unscheduled") },
{ assertEquals(0, monitorResults.queuedVms, "No VM should not be in the queue") },
{ assertEquals(1672916917970, monitor.totalRequestedBurst) { "Incorrect requested burst" } },
- { assertEquals(435179794565, monitor.totalGrantedBurst) { "Incorrect granted burst" } },
+ { assertEquals(434262255818, monitor.totalGrantedBurst) { "Incorrect granted burst" } },
{ assertEquals(1236692477983, monitor.totalOvercommissionedBurst) { "Incorrect overcommitted burst" } },
{ assertEquals(0, monitor.totalInterferedBurst) { "Incorrect interfered burst" } }
)
@@ -157,7 +157,7 @@ class CapelinIntegrationTest {
// Note that these values have been verified beforehand
assertAll(
{ assertEquals(702636229989, monitor.totalRequestedBurst) { "Total requested work incorrect" } },
- { assertEquals(172807361391, monitor.totalGrantedBurst) { "Total granted work incorrect" } },
+ { assertEquals(172636987071, monitor.totalGrantedBurst) { "Total granted work incorrect" } },
{ assertEquals(528959213229, monitor.totalOvercommissionedBurst) { "Total overcommitted work incorrect" } },
{ assertEquals(0, monitor.totalInterferedBurst) { "Total interfered work incorrect" } }
)