summaryrefslogtreecommitdiff
path: root/opendc-faas/opendc-faas-simulator/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-06 15:34:19 +0200
committerGitHub <noreply@github.com>2022-10-06 15:34:19 +0200
commit7ba3b953300c46b4e3afcde17cd3dd14b1af8406 (patch)
tree950ba678869ec868c26ab3b95b57e4cabadb23c7 /opendc-faas/opendc-faas-simulator/src
parentc2047d09b27b0c05f5c203509dde524e17d3b729 (diff)
parent47357afd16f928260db34d4dd3e686fb9ee7c5ff (diff)
merge: Update build and runtime dependencies (#107)
This pull request updates the build and runtime dependencies used by OpenDC to their latest version compatible with the project. ## Implementation Notes :hammer_and_pick: * Update simulator dependency versions * Remove unused distribution conventions * Update next version to 3.0 * Eliminate use of wildcard imports * Switch to Spotless for formatting
Diffstat (limited to 'opendc-faas/opendc-faas-simulator/src')
-rw-r--r--opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt9
-rw-r--r--opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt2
-rw-r--r--opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt4
3 files changed, 11 insertions, 4 deletions
diff --git a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
index 22131b13..eba90cce 100644
--- a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
+++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
@@ -22,8 +22,15 @@
package org.opendc.faas.simulator
-import kotlinx.coroutines.*
+import kotlinx.coroutines.CancellationException
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.cancel
import kotlinx.coroutines.channels.Channel
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.isActive
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.suspendCancellableCoroutine
import org.opendc.faas.service.FunctionObject
import org.opendc.faas.service.deployer.FunctionDeployer
import org.opendc.faas.service.deployer.FunctionInstance
diff --git a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt
index 9442e2d3..d3b31bb9 100644
--- a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt
+++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt
@@ -23,7 +23,7 @@
package org.opendc.faas.simulator.delay
import org.opendc.faas.service.deployer.FunctionInstance
-import java.util.*
+import java.util.Random
import kotlin.math.abs
/*
diff --git a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
index 317eb0aa..9970d93a 100644
--- a/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
+++ b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt
@@ -44,7 +44,7 @@ import org.opendc.simulator.compute.workload.SimRuntimeWorkload
import org.opendc.simulator.compute.workload.SimWorkload
import org.opendc.simulator.kotlin.runSimulation
import java.time.Duration
-import java.util.*
+import java.util.Random
/**
* A test suite for the [FaaSService] implementation under simulated conditions.
@@ -101,7 +101,7 @@ internal class SimFaaSServiceTest {
{ assertEquals(1, funcStats.delayedInvocations) },
{ assertEquals(0, funcStats.failedInvocations) },
{ assertEquals(100.0, funcStats.waitTime.mean) },
- { assertEquals(1285.0, funcStats.activeTime.mean) },
+ { assertEquals(1285.0, funcStats.activeTime.mean) }
)
}
}