diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2020-04-10 23:21:21 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2020-04-10 23:21:21 +0200 |
| commit | 5310dd64606f398bddcaef87f26eee94b663b39d (patch) | |
| tree | 8cb4c2a4643962d43b83bb8804f84611d5196d18 /opendc/opendc-experiments-sc20 | |
| parent | ebcda5df6a858256d2022f091d10da4083b00258 (diff) | |
| parent | ead9f9680792878f51be58d931c6337edeefae4b (diff) | |
Merge branch 'bug/virt-driver-interference' into '2.x'
Fix incorrect reporting of overcommission
See merge request opendc/opendc-simulator!53
Diffstat (limited to 'opendc/opendc-experiments-sc20')
2 files changed, 17 insertions, 12 deletions
diff --git a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/Sc20Monitor.kt b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/Sc20Monitor.kt index 212b1bfb..c0d6de03 100644 --- a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/Sc20Monitor.kt +++ b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/Sc20Monitor.kt @@ -17,21 +17,22 @@ class Sc20Monitor( private val lastServerStates = mutableMapOf<Server, Pair<ServerState, Long>>() init { - outputFile.write("time,duration,requestedBurst,grantedBurst,numberOfDeployedImages,server,hostState,hostUsage,powerDraw,failedVms\n") + outputFile.write("time,duration,requestedBurst,grantedBurst,overcommissionedBurst,interferedBurst,numberOfDeployedImages,server,hostState,hostUsage,powerDraw,failedVms\n") } suspend fun onVmStateChanged(server: Server) {} suspend fun serverStateChanged(driver: VirtDriver, server: Server) { - if ((server.state == ServerState.SHUTOFF || server.state == ServerState.ERROR) && - lastServerStates.containsKey(server) - ) { - val duration = simulationContext.clock.millis() - lastServerStates[server]!!.second + val lastServerState = lastServerStates[server] + if (server.state == ServerState.SHUTOFF && lastServerState != null) { + val duration = simulationContext.clock.millis() - lastServerState.second onSliceFinish( simulationContext.clock.millis(), 0, 0, 0, + 0, + 0, server, duration ) @@ -46,6 +47,8 @@ class Sc20Monitor( time: Long, requestedBurst: Long, grantedBurst: Long, + overcommissionedBurst: Long, + interferedBurst: Long, numberOfDeployedImages: Int, hostServer: Server, duration: Long = 5 * 60 * 1000L @@ -57,7 +60,7 @@ class Sc20Monitor( val usage = driver.usage.first() val powerDraw = driver.powerDraw.first() - outputFile.write("$time,$duration,$requestedBurst,$grantedBurst,$numberOfDeployedImages,${hostServer.uid},${hostServer.state},$usage,$powerDraw") + outputFile.write("$time,$duration,$requestedBurst,$grantedBurst,$overcommissionedBurst,$interferedBurst,$numberOfDeployedImages,${hostServer.uid},${hostServer.state},$usage,$powerDraw") outputFile.newLine() } diff --git a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt index 3392bd02..ede18b40 100644 --- a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt +++ b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt @@ -28,7 +28,6 @@ import com.atlarge.odcsim.Domain import com.atlarge.odcsim.SimulationEngineProvider import com.atlarge.odcsim.simulationContext import com.atlarge.opendc.compute.core.Flavor -import com.atlarge.opendc.compute.core.Server import com.atlarge.opendc.compute.core.ServerEvent import com.atlarge.opendc.compute.core.ServerState import com.atlarge.opendc.compute.metal.NODE_CLUSTER @@ -200,6 +199,8 @@ fun main(args: Array<String>) { simulationContext.clock.millis(), event.requestedBurst, event.grantedBurst, + event.overcommissionedBurst, + event.interferedBurst, event.numberOfDeployedImages, event.hostServer ) @@ -226,20 +227,21 @@ fun main(args: Array<String>) { null } - val running = mutableSetOf<Server>() val finish = Channel<Unit>(Channel.RENDEZVOUS) + var submitted = 0 + var finished = 0 val reader = Sc20TraceReader(File(traceDirectory), performanceInterferenceModel, getSelectedVmList()) while (reader.hasNext()) { val (time, workload) = reader.next() delay(max(0, time - simulationContext.clock.millis())) + submitted++ launch { chan.send(Unit) val server = scheduler.deploy( workload.image.name, workload.image, - Flavor(workload.image.cores, workload.image.requiredMemory) + Flavor(workload.image.maxCores, workload.image.requiredMemory) ) - running += server // Monitor server events server.events .onEach { @@ -248,10 +250,10 @@ fun main(args: Array<String>) { // Detect whether the VM has finished running if (it.server.state == ServerState.SHUTOFF) { - running -= server + finished++ } - if (running.isEmpty() && !reader.hasNext()) { + if (finished == submitted && !reader.hasNext()) { finish.send(Unit) } } |
