diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-21 17:00:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-21 17:00:09 +0200 |
| commit | 10dfc257de65cbbd1e25d1d7f5833bfb687d85ed (patch) | |
| tree | 48b102c4d45b366abd8d0d368c31d6c0596ac30f /simulator/opendc-runner-web/src | |
| parent | b4d1289bbd9539c041e8aeb39bb8962628399809 (diff) | |
| parent | 62678b2890a7f3640836b99ca2fec9efd7485929 (diff) | |
simulator: Introduce SimulationCoroutineDispatcher (#120)
This change introduces the SimulationCoroutineDispatcher implementation which replaces the TestCoroutineDispatcher for running single-threaded simulations.
Diffstat (limited to 'simulator/opendc-runner-web/src')
| -rw-r--r-- | simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt index 31f7876e..09f7de35 100644 --- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt +++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt @@ -38,7 +38,6 @@ import io.opentelemetry.sdk.metrics.SdkMeterProvider import io.opentelemetry.sdk.metrics.export.MetricProducer import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.test.runBlockingTest import mu.KotlinLogging import org.bson.Document import org.bson.types.ObjectId @@ -52,7 +51,7 @@ import org.opendc.experiments.capelin.trace.Sc20ParquetTraceReader import org.opendc.experiments.capelin.trace.Sc20RawParquetTraceReader import org.opendc.format.environment.EnvironmentReader import org.opendc.format.trace.sc20.Sc20PerformanceInterferenceReader -import org.opendc.simulator.utils.DelayControllerClockAdapter +import org.opendc.simulator.core.runBlockingSimulation import org.opendc.telemetry.sdk.toOtelClock import java.io.File import kotlin.random.Random @@ -210,14 +209,13 @@ public class RunnerCli : CliktCommand(name = "runner") { val monitor = WebExperimentMonitor() try { - runBlockingTest { + runBlockingSimulation { val seed = repeat val traceDocument = scenario.get("trace", Document::class.java) val workloadName = traceDocument.getString("traceId") val workloadFraction = traceDocument.get("loadSamplingFraction", Number::class.java).toDouble() val seeder = Random(seed) - val clock = DelayControllerClockAdapter(this) val chan = Channel<Unit>(Channel.CONFLATED) |
