diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-25 18:15:07 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-25 18:15:07 +0200 |
| commit | e6dd553cf77445083f2c7632bd3b4c3611d76d0a (patch) | |
| tree | 555e1c1763b8a16291b957ecd5b2917acf74cf96 /opendc-simulator/opendc-simulator-compute/src/main | |
| parent | f111081627280d4e7e1d7147c56cdce708e32433 (diff) | |
fix(simulator): Eliminate unnecessary double to long conversions
This change eliminates unnecessary double to long conversions in the
simulator. Previously, we used longs to denote the amount of work.
However, in the mean time we have switched to doubles in the lower
stack.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/main')
2 files changed, 8 insertions, 8 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt index c31b1f6b..3b44292d 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisor.kt @@ -77,10 +77,10 @@ public class SimFairShareHypervisor( if (timestamp > lastReport) { listener.onSliceFinish( this@SimFairShareHypervisor, - (counters.demand - lastDemand).toLong(), - (counters.actual - lastActual).toLong(), - (counters.overcommit - lastOvercommit).toLong(), - (counters.interference - lastInterference).toLong(), + counters.demand - lastDemand, + counters.actual - lastActual, + counters.overcommit - lastOvercommit, + counters.interference - lastInterference, lastCpuUsage, lastCpuDemand ) diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt index d3996914..af28c346 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/kernel/SimHypervisor.kt @@ -64,10 +64,10 @@ public interface SimHypervisor : SimWorkload { */ public fun onSliceFinish( hypervisor: SimHypervisor, - requestedWork: Long, - grantedWork: Long, - overcommittedWork: Long, - interferedWork: Long, + requestedWork: Double, + grantedWork: Double, + overcommittedWork: Double, + interferedWork: Double, cpuUsage: Double, cpuDemand: Double ) |
