summaryrefslogtreecommitdiff
path: root/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-08 20:44:30 +0200
committerGitHub <noreply@github.com>2021-04-08 20:44:30 +0200
commit5fdbfbe7d340bc10f8b9eebd5aa23bdfd7dc4e18 (patch)
tree21020cd0451664006a5bf291a5c27dd74f6129d0 /simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin
parent3fd45fc5befb1fc9a67d4494e8a3786a5dceae3a (diff)
parent831ba3d882a46dad2abe6ac281b736b729dc7080 (diff)
exp: Add serverless experiments (v1)
This pull request is the first in a series of pull request to add the serverless experiments from Soufiane Jounaid's BSc thesis to the main OpenDC repository. In this pull request, we add the serverless experiment and trace reader. * Add `opendc-experiments-serverless20` which will contain the serverless experiments. * Add `ServerlessTraceReader` which reads the traces from Soufiane's work. * Add support for cold start delays * Expose metrics per function.
Diffstat (limited to 'simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin')
-rw-r--r--simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt2
-rw-r--r--simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt5
2 files changed, 7 insertions, 0 deletions
diff --git a/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt b/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt
index f14f4977..b66369ec 100644
--- a/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt
+++ b/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt
@@ -51,11 +51,13 @@ public interface ServerlessClient : AutoCloseable {
* Create a new serverless function.
*
* @param name The name of the function.
+ * @param memorySize The memory allocated for the function in MB.
* @param labels The labels associated with the function.
* @param meta The metadata associated with the function.
*/
public suspend fun newFunction(
name: String,
+ memorySize: Long,
labels: Map<String, String> = emptyMap(),
meta: Map<String, Any> = emptyMap()
): ServerlessFunction
diff --git a/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt b/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt
index ec0fad71..f1360966 100644
--- a/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt
+++ b/simulator/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt
@@ -39,6 +39,11 @@ public interface ServerlessFunction {
public val name: String
/**
+ * The amount of memory allocated for this function in MB.
+ */
+ public val memorySize: Long
+
+ /**
* The identifying labels attached to the resource.
*/
public val labels: Map<String, String>