From 3d5eb562227dcad5a8a60f31b96e6d68f7774fb2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 23 Sep 2022 12:27:09 +0200 Subject: refactor(compute): Provide access to instances in compute service This change updates the interface of `ComputeService` to provide access to the instances (servers) that have been registered with the compute service. This allows metric collectors to query the metrics of the servers that are currently running. --- .../experiments/capelin/CapelinIntegrationTest.kt | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'opendc-experiments/opendc-experiments-capelin/src/test') 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 bf8c2758..eae3c993 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 @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertAll -import org.opendc.compute.api.Server import org.opendc.compute.service.scheduler.FilterScheduler import org.opendc.compute.service.scheduler.filters.ComputeFilter import org.opendc.compute.service.scheduler.filters.RamFilter @@ -90,13 +89,11 @@ class CapelinIntegrationTest { seed, ) val topology = createTopology() - - val servers = mutableListOf() - val reader = ComputeMetricReader(this, clock, runner.service, servers, monitor) + val reader = ComputeMetricReader(this, clock, runner.service, monitor) try { runner.apply(topology) - runner.run(workload, servers) + runner.run(workload) val serviceMetrics = runner.service.getSchedulerStats() println( @@ -140,12 +137,11 @@ class CapelinIntegrationTest { seed, ) val topology = createTopology("single") - val servers = mutableListOf() - val reader = ComputeMetricReader(this, clock, runner.service, servers, monitor) + val reader = ComputeMetricReader(this, clock, runner.service, monitor) try { runner.apply(topology) - runner.run(workload, servers) + runner.run(workload) val serviceMetrics = runner.service.getSchedulerStats() println( @@ -186,12 +182,11 @@ class CapelinIntegrationTest { seed ) val topology = createTopology("single") - val servers = mutableListOf() - val reader = ComputeMetricReader(this, clock, simulator.service, servers, monitor) + val reader = ComputeMetricReader(this, clock, simulator.service, monitor) try { simulator.apply(topology) - simulator.run(workload, servers, interference = true) + simulator.run(workload, interference = true) val serviceMetrics = simulator.service.getSchedulerStats() println( @@ -230,12 +225,11 @@ class CapelinIntegrationTest { ) val topology = createTopology("single") val workload = createTestWorkload(0.25, seed) - val servers = mutableListOf() - val reader = ComputeMetricReader(this, clock, simulator.service, servers, monitor) + val reader = ComputeMetricReader(this, clock, simulator.service, monitor) try { simulator.apply(topology) - simulator.run(workload, servers, failureModel = grid5000(Duration.ofDays(7))) + simulator.run(workload, failureModel = grid5000(Duration.ofDays(7))) val serviceMetrics = simulator.service.getSchedulerStats() println( -- cgit v1.2.3