summaryrefslogtreecommitdiff
path: root/simulator/opendc-runner-web/src/main/kotlin
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-21 17:00:09 +0200
committerGitHub <noreply@github.com>2021-04-21 17:00:09 +0200
commit10dfc257de65cbbd1e25d1d7f5833bfb687d85ed (patch)
tree48b102c4d45b366abd8d0d368c31d6c0596ac30f /simulator/opendc-runner-web/src/main/kotlin
parentb4d1289bbd9539c041e8aeb39bb8962628399809 (diff)
parent62678b2890a7f3640836b99ca2fec9efd7485929 (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/main/kotlin')
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/Main.kt6
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)