From df6d8e1a752dd546d6e8b5ad42e6875b3fd829e5 Mon Sep 17 00:00:00 2001
From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de>
Date: Fri, 29 Jan 2021 16:18:52 +0100
Subject: [PATCH] begin with UC1Benchmark implementation

---
 .../theodolite/evaluation/SLOChecker.kt       |  4 ++++
 .../execution/KafkaBenchmarkExecutor.kt       |  2 +-
 .../kotlin/theodolite/k8s/UC1Benchmark.kt     | 20 +++++++++++++++++++
 .../k8s/WorkloadGeneratorStateCleaner.kt      |  6 +++---
 .../main/kotlin/theodolite/util/Benchmark.kt  |  4 ++--
 .../kotlin/theodolite/util/KafkaBenchmark.kt  |  4 ++++
 6 files changed, 34 insertions(+), 6 deletions(-)
 create mode 100644 theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SLOChecker.kt
 create mode 100644 theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt

diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SLOChecker.kt b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SLOChecker.kt
new file mode 100644
index 000000000..10e113fdf
--- /dev/null
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/evaluation/SLOChecker.kt
@@ -0,0 +1,4 @@
+package theodolite.evaluation
+
+interface SLOChecker {
+}
\ No newline at end of file
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt
index e019e80d0..9a3885e25 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt
@@ -15,7 +15,7 @@ class KafkaBenchmarkExecutor(benchmark: Benchmark, results: Results, executionDu
         this.waitAndLog()
         benchmark.stop()
         // todo evaluate
-        val result = false // if success else falsew
+        val result = false // if success else false
         this.results.setResult(Pair(load, res), result)
         return result;
     }
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt
new file mode 100644
index 000000000..75ba7f42f
--- /dev/null
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt
@@ -0,0 +1,20 @@
+package theodolite.k8s
+
+import theodolite.util.Benchmark
+import theodolite.util.LoadDimension
+import theodolite.util.Resource
+
+class UC1Benchmark(config: Map<String, Any>) : Benchmark(config) {
+    override fun start(load: LoadDimension, resources: Resource) {
+        TODO("Not yet implemented")
+    }
+
+    override fun stop() {
+        TODO("Not yet implemented")
+    }
+
+    override fun startWorkloadGenerator(wg: String, load: LoadDimension, ucId: String) {
+        TODO("Not yet implemented")
+    }
+
+}
\ No newline at end of file
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt
index c519b0c84..5ab9ad222 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt
@@ -50,9 +50,9 @@ class WorkloadGeneratorStateCleaner(ip: String) {
 
         System.out.println("ZooKeeper reset was successful")
     }
-}
 
-private class ZookeperWatcher : Watcher {
+    private class ZookeperWatcher : Watcher {
 
-    override fun process(event: WatchedEvent) {}
+        override fun process(event: WatchedEvent) {}
+    }
 }
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt
index c3ddab0fa..e9add1a50 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt
@@ -2,10 +2,10 @@ package theodolite.util
 
 // todo: needs cluster and resource config
 abstract class Benchmark(val config: Map<String, Any>) {
-    abstract fun start();
+    abstract fun start(load: LoadDimension, resources: Resource);
 
     abstract fun stop();
 
-    abstract fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String);
+    abstract fun startWorkloadGenerator(wg: String, load: LoadDimension, ucId: String);
 
 }
\ No newline at end of file
diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaBenchmark.kt
index 3ed499bf6..74201393b 100644
--- a/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaBenchmark.kt
+++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaBenchmark.kt
@@ -10,4 +10,8 @@ class KafkaBenchmark(config: Map<String, Any>): Benchmark(config) {
         TODO("Not yet implemented")
     }
 
+    override fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String) {
+        TODO("Not yet implemented")
+    }
+
 }
\ No newline at end of file
-- 
GitLab