diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-01 20:42:43 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-08 20:19:49 +0200 |
| commit | 69a881dca5ace9ba4ed294f72fd9a192fab83b3f (patch) | |
| tree | 459b6a77f02f93517f2aecb883272987971a0d47 /simulator/opendc-serverless/opendc-serverless-simulator | |
| parent | 8df422ca5164bd712caf594951669ebeb656f5fb (diff) | |
serverless: Track metrics per function
This change adds metrics that are tracked per function instance, which
includes the runtime of the invocations, the number of invocations
(total, warm, cold, failed).
Diffstat (limited to 'simulator/opendc-serverless/opendc-serverless-simulator')
2 files changed, 5 insertions, 4 deletions
diff --git a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt index 160f8ebb..fd9d910a 100644 --- a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt +++ b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt @@ -24,7 +24,7 @@ package org.opendc.serverless.simulator import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel -import org.opendc.serverless.api.ServerlessFunction +import org.opendc.serverless.service.FunctionObject import org.opendc.serverless.service.deployer.FunctionDeployer import org.opendc.serverless.service.deployer.FunctionInstance import org.opendc.serverless.service.deployer.FunctionInstanceState @@ -51,7 +51,7 @@ public class SimFunctionDeployer( private val mapper: SimServerlessWorkloadMapper ) : FunctionDeployer { - override fun deploy(function: ServerlessFunction): Instance { + override fun deploy(function: FunctionObject): Instance { val instance = Instance(function) instance.start() return instance @@ -60,7 +60,7 @@ public class SimFunctionDeployer( /** * A simulated [FunctionInstance]. */ - public inner class Instance(override val function: ServerlessFunction) : FunctionInstance { + public inner class Instance(override val function: FunctionObject) : FunctionInstance { /** * The workload associated with this instance. */ diff --git a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt index 670f978d..3a47eb53 100644 --- a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt +++ b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt @@ -23,6 +23,7 @@ package org.opendc.serverless.simulator.workload import org.opendc.serverless.api.ServerlessFunction +import org.opendc.serverless.service.FunctionObject /** * A [SimServerlessWorkloadMapper] is responsible for mapping a [ServerlessFunction] to a [SimServerlessWorkload] that @@ -32,5 +33,5 @@ public fun interface SimServerlessWorkloadMapper { /** * Map the specified [function] to a [SimServerlessWorkload] that can be simulated. */ - public fun createWorkload(function: ServerlessFunction): SimServerlessWorkload + public fun createWorkload(function: FunctionObject): SimServerlessWorkload } |
