diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-04-10 21:53:33 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-04-10 21:53:33 +0200 |
| commit | ead9f9680792878f51be58d931c6337edeefae4b (patch) | |
| tree | 267afb4ccf2d32d069a779da8ae1f33a9dae2ba2 | |
| parent | b7f01dfdfaed87fdc7d58a9587eb50808a16d602 (diff) | |
bug: Do not report error states as final state
2 files changed, 3 insertions, 5 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 a5b13f84..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 @@ -23,10 +23,9 @@ class Sc20Monitor( 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, 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 8eeffa6b..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 |
