summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-capelin/src/test
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-22 14:45:12 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-22 14:50:00 +0200
commit17fa7619f1d7e96680e018d3f12f333fb75cdac1 (patch)
tree5acabfb33d5fa2c624926df91264e460d2afb761 /opendc-experiments/opendc-experiments-capelin/src/test
parent8b6c15193281171bcb2e111f339ffb8da385332b (diff)
refactor(sim/compute): Make interference domain independent of profile
This change updates the virtual machine performance interference model so that the interference domain can be constructed independently of the interference profile. As a consequence, the construction of the topology now does not depend anymore on the interference profile.
Diffstat (limited to 'opendc-experiments/opendc-experiments-capelin/src/test')
-rw-r--r--opendc-experiments/opendc-experiments-capelin/src/test/kotlin/org/opendc/experiments/capelin/CapelinIntegrationTest.kt17
1 files changed, 8 insertions, 9 deletions
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 ff9faef7..af846dd6 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
@@ -82,7 +82,7 @@ class CapelinIntegrationTest {
@Test
fun testLarge() = runBlockingSimulation {
val seed = 0L
- val (workload, _) = createTestWorkload(1.0, seed)
+ val workload = createTestWorkload(1.0, seed)
val runner = ComputeServiceHelper(
coroutineContext,
clock,
@@ -132,7 +132,7 @@ class CapelinIntegrationTest {
@Test
fun testSmall() = runBlockingSimulation {
val seed = 1L
- val (workload, _) = createTestWorkload(0.25, seed)
+ val workload = createTestWorkload(0.25, seed)
val runner = ComputeServiceHelper(
coroutineContext,
clock,
@@ -177,14 +177,13 @@ class CapelinIntegrationTest {
@Test
fun testInterference() = runBlockingSimulation {
val seed = 0L
- val (workload, interferenceModel) = createTestWorkload(1.0, seed)
+ val workload = createTestWorkload(1.0, seed)
val simulator = ComputeServiceHelper(
coroutineContext,
clock,
computeScheduler,
- seed,
- interferenceModel = interferenceModel
+ seed
)
val topology = createTopology("single")
val servers = mutableListOf<Server>()
@@ -192,7 +191,7 @@ class CapelinIntegrationTest {
try {
simulator.apply(topology)
- simulator.run(workload, servers)
+ simulator.run(workload, servers, interference = true)
val serviceMetrics = simulator.service.getSchedulerStats()
println(
@@ -213,7 +212,7 @@ class CapelinIntegrationTest {
{ assertEquals(6028050, this@CapelinIntegrationTest.monitor.idleTime) { "Idle time incorrect" } },
{ assertEquals(14712749, this@CapelinIntegrationTest.monitor.activeTime) { "Active time incorrect" } },
{ assertEquals(12532907, this@CapelinIntegrationTest.monitor.stealTime) { "Steal time incorrect" } },
- { assertEquals(477068, this@CapelinIntegrationTest.monitor.lostTime) { "Lost time incorrect" } }
+ { assertEquals(485510, this@CapelinIntegrationTest.monitor.lostTime) { "Lost time incorrect" } }
)
}
@@ -231,7 +230,7 @@ class CapelinIntegrationTest {
grid5000(Duration.ofDays(7))
)
val topology = createTopology("single")
- val (workload, _) = createTestWorkload(0.25, seed)
+ val workload = createTestWorkload(0.25, seed)
val servers = mutableListOf<Server>()
val reader = ComputeMetricReader(this, clock, simulator.service, servers, monitor)
@@ -266,7 +265,7 @@ class CapelinIntegrationTest {
/**
* Obtain the trace reader for the test.
*/
- private fun createTestWorkload(fraction: Double, seed: Long): ComputeWorkload.Resolved {
+ private fun createTestWorkload(fraction: Double, seed: Long): List<VirtualMachine> {
val source = trace("bitbrains-small").sampleByLoad(fraction)
return source.resolve(workloadLoader, Random(seed))
}