diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-22 22:39:33 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-22 22:39:33 +0200 |
| commit | d97356cf696dedb6c26fc42d9d7c44a977264dcd (patch) | |
| tree | f7c8cf2c7e808dfa234c77c25d6fc24b38826d39 /opendc-experiments | |
| parent | 92787292269783701cb7f1082f0262e7e2851df9 (diff) | |
refactor(compute): Pass failure model during workload evaluation
This change updates the `ComputeServiceHelper` class to provide the
failure model via a parameter to the `run` method instead of constructor
parameter. This separates the construction of the topology from the
simulation of the workload.
Diffstat (limited to 'opendc-experiments')
2 files changed, 3 insertions, 5 deletions
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt index 7be09ff5..98702b4c 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/CapelinRunner.kt @@ -74,7 +74,6 @@ public class CapelinRunner( clock, computeScheduler, seed, - failureModel ) val topology = clusterTopology(File(envPath, "${scenario.topology.name}.txt")) @@ -104,7 +103,7 @@ public class CapelinRunner( runner.apply(topology, optimize = true) // Run the workload trace - runner.run(vms, servers, interference = operationalPhenomena.hasInterference) + runner.run(vms, servers, failureModel = failureModel, interference = operationalPhenomena.hasInterference) // Stop the metric collection exporter?.close() diff --git a/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt b/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt index af846dd6..bf8c2758 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt @@ -226,8 +226,7 @@ class CapelinIntegrationTest { coroutineContext, clock, computeScheduler, - seed, - grid5000(Duration.ofDays(7)) + seed ) val topology = createTopology("single") val workload = createTestWorkload(0.25, seed) @@ -236,7 +235,7 @@ class CapelinIntegrationTest { try { simulator.apply(topology) - simulator.run(workload, servers) + simulator.run(workload, servers, failureModel = grid5000(Duration.ofDays(7))) val serviceMetrics = simulator.service.getSchedulerStats() println( |
