summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-simulator/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-06-21 14:34:10 +0200
committerGitHub <noreply@github.com>2021-06-21 14:34:10 +0200
commitba32561e4b0e00c00d528df615a58e396e0fddc0 (patch)
tree06bbb8161910a81b3dc1160b180650660bc50be4 /opendc-compute/opendc-compute-simulator/src/test
parentb8b0f39028af90fa54b42a00214b2ea9a5e48e2e (diff)
parent966715d7df139a431293f5c2fc67916fbcc1ecfb (diff)
simulator: Optimize resource interpreter implementation
This pull request implements several optimizations in the resource interpreter implementation. * Interpreter is now shared across hosts in experiments * Interpreter allocations are pooled where possible * Resource lifecycle concept is eliminated * Optimized flag management in interpreter
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src/test')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
index a6cff3ba..79489fdb 100644
--- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
+++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
@@ -47,6 +47,7 @@ import org.opendc.simulator.compute.model.ProcessingNode
import org.opendc.simulator.compute.model.ProcessingUnit
import org.opendc.simulator.compute.workload.SimTraceWorkload
import org.opendc.simulator.core.runBlockingSimulation
+import org.opendc.simulator.resources.SimResourceInterpreter
import org.opendc.telemetry.sdk.metrics.export.CoroutineMetricReader
import org.opendc.telemetry.sdk.toOtelClock
import java.util.UUID
@@ -83,7 +84,8 @@ internal class SimHostTest {
.setClock(clock.toOtelClock())
.build()
- val virtDriver = SimHost(UUID.randomUUID(), "test", machineModel, emptyMap(), coroutineContext, clock, meterProvider.get("opendc-compute-simulator"), SimFairShareHypervisorProvider())
+ val interpreter = SimResourceInterpreter(coroutineContext, clock)
+ val virtDriver = SimHost(UUID.randomUUID(), "test", machineModel, emptyMap(), coroutineContext, interpreter, meterProvider.get("opendc-compute-simulator"), SimFairShareHypervisorProvider())
val duration = 5 * 60L
val vmImageA = MockImage(
UUID.randomUUID(),