summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-flow
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-01-11 14:12:30 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-02-18 16:59:51 +0100
commit9e69eaf1c7b0c4985d37f3f4595e2e2478d389f2 (patch)
treec4d316572f0abd96434b86d32174dceb6d09d679 /opendc-simulator/opendc-simulator-flow
parent841eaeb84a96cb1b20172b1ab293ebef0bb573a5 (diff)
perf(simulator): Move logger field out of class
This change updates the FlowConsumerContextImpl by moving the logger outside of the class. This prevents each instance of this class from having to construct a logger instance.
Diffstat (limited to 'opendc-simulator/opendc-simulator-flow')
-rw-r--r--opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
index 58ca918b..1d39d61c 100644
--- a/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
+++ b/opendc-simulator/opendc-simulator-flow/src/main/kotlin/org/opendc/simulator/flow/internal/FlowConsumerContextImpl.kt
@@ -29,6 +29,11 @@ import kotlin.math.max
import kotlin.math.min
/**
+ * The logging instance of this connection.
+ */
+private val logger = KotlinLogging.logger {}
+
+/**
* Implementation of a [FlowConnection] managing the communication between flow sources and consumers.
*/
internal class FlowConsumerContextImpl(
@@ -37,11 +42,6 @@ internal class FlowConsumerContextImpl(
private val logic: FlowConsumerLogic
) : FlowConsumerContext {
/**
- * The logging instance of this connection.
- */
- private val logger = KotlinLogging.logger {}
-
- /**
* The capacity of the connection.
*/
override var capacity: Double