summaryrefslogtreecommitdiff
path: root/opendc-experiments
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-31 15:02:37 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-31 15:50:36 +0100
commitc9750e52a10157f3838b934fed4f04fae69c539a (patch)
tree1dd498da02298c9924f6c37974f4311df6948cb2 /opendc-experiments
parent587a5af75d9adee5a3f765261931cd6e8ab6ff43 (diff)
feat(sim/compute): Add support for snapshotting workloads
This change updates the interface of `SimWorkload` to support snapshotting workloads. We introduce a new method `snapshot()` to this interface which returns a new `SimWorkload` that can be started at a later point in time and on another `SimMachine`, which continues progress from the moment the workload was snapshotted.
Diffstat (limited to 'opendc-experiments')
-rw-r--r--opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
index a7fc102a..eb308970 100644
--- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
+++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt
@@ -127,6 +127,8 @@ public class SimTFDevice(
output = null
}
+ override fun snapshot(): SimWorkload = throw UnsupportedOperationException()
+
override fun onUpdate(ctx: FlowStage, now: Long): Long {
val output = output ?: return Long.MAX_VALUE
val lastPull = lastPull