From 9991418cdb3c63bd9df176d508c1eb1c7adb7d0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Thu, 24 Nov 2022 15:56:10 +0100
Subject: [PATCH] Add resource type for threads in Kafka Streams

---
 .../uc1-kstreams-benchmark-operator.yaml      | 21 +++++++++++++++++++
 .../uc2-kstreams-benchmark-operator.yaml      | 21 +++++++++++++++++++
 .../uc3-kstreams-benchmark-operator.yaml      | 21 +++++++++++++++++++
 .../uc4-kstreams-benchmark-operator.yaml      | 21 +++++++++++++++++++
 4 files changed, 84 insertions(+)

diff --git a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-kstreams-benchmark-operator.yaml
index 93590ee0e..6f8f39b39 100644
--- a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-kstreams-benchmark-operator.yaml
@@ -24,6 +24,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc1-kstreams-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc1-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            variableName: NUM_STREAM_THREADS
+        - type: ResourceLimitPatcher
+          resource: uc1-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc1-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
index 5856ee45e..25acd09d5 100644
--- a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-kstreams-benchmark-operator.yaml
@@ -24,6 +24,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc2-kstreams-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc2-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            variableName: NUM_STREAM_THREADS
+        - type: ResourceLimitPatcher
+          resource: uc2-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc2-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
index 2fca5cb26..c527f20a0 100644
--- a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-kstreams-benchmark-operator.yaml
@@ -24,6 +24,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc3-kstreams-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc3-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            variableName: NUM_STREAM_THREADS
+        - type: ResourceLimitPatcher
+          resource: uc3-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc3-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
index 489fc8eb0..06e692f60 100644
--- a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-kstreams-benchmark-operator.yaml
@@ -24,6 +24,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc4-kstreams-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc4-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            variableName: NUM_STREAM_THREADS
+        - type: ResourceLimitPatcher
+          resource: uc4-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc4-kstreams-deployment.yaml
+          properties:
+            container: uc-application
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumNestedGroups"
       patchers:
-- 
GitLab