diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-06-21 14:34:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-21 14:34:10 +0200 |
| commit | ba32561e4b0e00c00d528df615a58e396e0fddc0 (patch) | |
| tree | 06bbb8161910a81b3dc1160b180650660bc50be4 /opendc-compute/opendc-compute-simulator/src/test | |
| parent | b8b0f39028af90fa54b42a00214b2ea9a5e48e2e (diff) | |
| parent | 966715d7df139a431293f5c2fc67916fbcc1ecfb (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.kt | 4 |
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(), |
