diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/Benchmark.kt deleted file mode 100644 index b680072787989093ab7cbc9a08bec31ed9968d44..0000000000000000000000000000000000000000 --- a/theodolite-quarkus/src/main/kotlin/theodolite/Benchmark.kt +++ /dev/null @@ -1,9 +0,0 @@ -package theodolite - -class Benchmark { - fun start() {} - - fun stop() {} - - fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String) { } -} diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/BenchmarkExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/BenchmarkExecutor.kt deleted file mode 100644 index 1790cfe81e96b5de098a7ca3f53d955886cb9827..0000000000000000000000000000000000000000 --- a/theodolite-quarkus/src/main/kotlin/theodolite/BenchmarkExecutor.kt +++ /dev/null @@ -1,17 +0,0 @@ -package theodolite - -class BenchmarkExecutor(benchmark: Benchmark) { - val benchmark: Benchmark = benchmark - - fun waitExecution(executionMinutes: Int) { - val milliToMinutes = 60000 - System.out.println("Wait while executing") - for (i in 1.rangeTo(executionMinutes)) { - Thread.sleep((milliToMinutes * i).toLong()) - System.out.println("Executed: $i minutes") - } - - System.out.println("Execution finished") - } - fun runExperiment() {} -} diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt index 730be87652b42c64f1aba9b7eee54427db05fcb7..e019e80d08d1c3b968311a4227a11b74b5c9368b 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/KafkaBenchmarkExecutor.kt @@ -1,19 +1,29 @@ package theodolite.execution +import mu.KotlinLogging import theodolite.util.Benchmark import theodolite.util.LoadDimension import theodolite.util.Resource import theodolite.util.Results import java.time.Duration +private val logger = KotlinLogging.logger {} + class KafkaBenchmarkExecutor(benchmark: Benchmark, results: Results, executionDuration: Duration) : BenchmarkExecutor(benchmark, results, executionDuration) { override fun runExperiment(load: LoadDimension, res: Resource): Boolean { benchmark.start() - // wait + this.waitAndLog() benchmark.stop() - // evaluate - val result = false // if success else false + // todo evaluate + val result = false // if success else falsew this.results.setResult(Pair(load, res), result) return result; } + + private fun waitAndLog() { + for (i in 1.rangeTo(executionDuration.toMinutes())) { + Thread.sleep(Duration.ofMinutes(1).toMillis()) + logger.info { "Executed: $i minutes" } + } + } } \ No newline at end of file diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TestBenchmarkExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TestBenchmarkExecutor.kt index d98ba3fb190732d03b9c74ac651ee0496c11ad58..5bcfa5e77ce78edf5af5478d6c1e4bb065b5e5f7 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TestBenchmarkExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TestBenchmarkExecutor.kt @@ -5,9 +5,10 @@ import theodolite.util.Benchmark import theodolite.util.LoadDimension import theodolite.util.Resource import theodolite.util.Results +import java.time.Duration class TestBenchmarkExecutor(private val mockResults: Array<Array<Boolean>>, benchmark: Benchmark, results: Results): - BenchmarkExecutor(benchmark, results) { + BenchmarkExecutor(benchmark, results, executionDuration = Duration.ofSeconds(1)) { override fun runExperiment(load: LoadDimension, res: Resource): Boolean { val result = this.mockResults[load.get()][res.get()] diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/TopicManager.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt similarity index 98% rename from theodolite-quarkus/src/main/kotlin/theodolite/TopicManager.kt rename to theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt index a62a8d8254d740f8362ea284c27aa43a6fdee71c..73daeda6f80372c3c35725b7e12c309a7d8fbce8 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/TopicManager.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt @@ -1,4 +1,4 @@ -package theodolite +package theodolite.k8s import org.apache.kafka.clients.admin.AdminClient import org.apache.kafka.clients.admin.AdminClientConfig diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/WorkloadGeneratorStateCleaner.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt similarity index 100% rename from theodolite-quarkus/src/main/kotlin/theodolite/WorkloadGeneratorStateCleaner.kt rename to theodolite-quarkus/src/main/kotlin/theodolite/k8s/WorkloadGeneratorStateCleaner.kt diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt index c4cb2be1715ad0387aa7d90d1a45eb708e9bfba2..c3ddab0fa64a71a948096ebb9d6805e30e57e184 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Benchmark.kt @@ -5,4 +5,7 @@ abstract class Benchmark(val config: Map<String, Any>) { abstract fun start(); abstract fun stop(); + + abstract fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String); + } \ No newline at end of file diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/TestBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/TestBenchmark.kt index e95c2070f9954e2c1800750da121288236880d81..6d2dbb1161acdfd501569be1d00d8c3f76c79d5f 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/TestBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/TestBenchmark.kt @@ -1,6 +1,6 @@ package theodolite.util -class TestBenchmark: Benchmark { +class TestBenchmark: Benchmark(config = emptyMap()) { override fun start() { TODO("Not yet implemented") } @@ -8,4 +8,8 @@ class TestBenchmark: Benchmark { override fun stop() { TODO("Not yet implemented") } + + override fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String) { + TODO("Not yet implemented") + } } \ No newline at end of file