diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-22 12:13:23 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-22 16:47:56 +0100 |
| commit | f616b720406250b1415593ff04c9d910b1fda54c (patch) | |
| tree | 1e90c30a2173d0b9a84840454d545a64200ac2b8 /simulator/opendc-simulator/opendc-simulator-compute/src | |
| parent | f1aa2632804916fb364f4fa207ac8ab97479f711 (diff) | |
simulator: Expose capacity and remaining work outside consumer callback
This change changes the consumer and context interfaces to expose the
provider capacity and remaining work via the context instance as opposed
to only via the callback. This simplifies aggregation of resources.
Diffstat (limited to 'simulator/opendc-simulator/opendc-simulator-compute/src')
| -rw-r--r-- | simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt b/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt index cc4f3136..e8050263 100644 --- a/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt +++ b/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt @@ -50,7 +50,7 @@ public class SimTraceWorkload(public val trace: Sequence<Fragment>) : SimWorkloa } private inner class CpuConsumer : SimResourceConsumer<SimProcessingUnit> { - override fun onNext(ctx: SimResourceContext<SimProcessingUnit>, capacity: Double, remainingWork: Double): SimResourceCommand { + override fun onNext(ctx: SimResourceContext<SimProcessingUnit>): SimResourceCommand { val now = ctx.clock.millis() val fragment = fragment ?: return SimResourceCommand.Exit val work = (fragment.duration / 1000) * fragment.usage |
