summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-network/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-01 22:04:35 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:41 +0200
commit081221684fb826ab5a00c1d8cc5a9886b9e2203c (patch)
tree7f2202429256b4cb96812f96b682a021f8236180 /opendc-simulator/opendc-simulator-network/src
parent6e424e9b44687d01e618e7bc38afc427610cd845 (diff)
feat(simulator): Expose CPU time counters directly on hypervisor
This change adds a new interface to the SimHypervisor interface that exposes the CPU time counters directly. These are derived from the flow counters and will be used by SimHost to expose them via telemetry.
Diffstat (limited to 'opendc-simulator/opendc-simulator-network/src')
-rw-r--r--opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtual.kt8
1 files changed, 3 insertions, 5 deletions
diff --git a/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtual.kt b/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtual.kt
index 2b7c1ad7..6667c80c 100644
--- a/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtual.kt
+++ b/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSwitchVirtual.kt
@@ -63,11 +63,9 @@ public class SimNetworkSwitchVirtual(private val engine: FlowEngine) : SimNetwor
get() = _provider
private val _provider = mux.newInput()
- override fun createConsumer(): FlowSource {
- val forwarder = FlowForwarder(engine, isCoupled = true)
- mux.addOutput(forwarder)
- return forwarder
- }
+ private val _source = mux.newOutput()
+
+ override fun createConsumer(): FlowSource = _source
override fun close() {
isClosed = true