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-compute | |
| 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-compute')
| -rw-r--r-- | opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 546584b6..dcc525cb 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -101,17 +101,17 @@ public class SimHost( listener = object : SimHypervisor.Listener { override fun onSliceFinish( hypervisor: SimHypervisor, - requestedWork: Long, - grantedWork: Long, - overcommittedWork: Long, - interferedWork: Long, + requestedWork: Double, + grantedWork: Double, + overcommittedWork: Double, + interferedWork: Double, cpuUsage: Double, cpuDemand: Double ) { - _totalWork.add(requestedWork.toDouble()) - _grantedWork.add(grantedWork.toDouble()) - _overcommittedWork.add(overcommittedWork.toDouble()) - _interferedWork.add(interferedWork.toDouble()) + _totalWork.add(requestedWork) + _grantedWork.add(grantedWork) + _overcommittedWork.add(overcommittedWork) + _interferedWork.add(interferedWork) _cpuDemand.record(cpuDemand) _cpuUsage.record(cpuUsage) _powerUsage.record(machine.psu.powerDraw) |
