diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index 9c7a279486784d74a61e09607651be929ac4cc5e..7c06856a8434db9d8ab9f7511c5fb5fcc148b375 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -2,7 +2,6 @@ package theodolite.benchmark import io.fabric8.kubernetes.api.model.KubernetesResource import io.fabric8.kubernetes.client.DefaultKubernetesClient -import org.apache.kafka.clients.admin.NewTopic import theodolite.k8s.K8sResourceLoader import theodolite.patcher.PatcherManager import theodolite.util.* @@ -22,7 +21,7 @@ class KubernetesBenchmark(): Benchmark { private fun loadKubernetesResources(resources: List<String>): List<Pair<String, KubernetesResource>> { val basePath = "./../../../resources/main/yaml/" var parser = YamlParser() - val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace("default")) + val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace("theodolite-she")) return resources .map { resource -> val resourcePath = "$basePath/$resource" @@ -33,11 +32,9 @@ class KubernetesBenchmark(): Benchmark { } override fun buildDeployment(load: LoadDimension, res: Resource, configurationOverrides: List<ConfigurationOverride>): BenchmarkDeployment { - // TODO("set node selector") val resources = loadKubernetesResources(this.appResource + this.loadGenResource) val patcherManager = PatcherManager() - // patch res and load patcherManager.createAndApplyPatcher(res.getType(), this.resourceTypes, resources, res.get()) patcherManager.createAndApplyPatcher(load.getType(), this.loadTypes, resources, load.get().toString()) @@ -46,8 +43,8 @@ class KubernetesBenchmark(): Benchmark { configurationOverrides.forEach{ override -> patcherManager.applyPatcher(listOf(override.patcher), resources, override.value)} return KubernetesBenchmarkDeployment( - resources.map { r -> r.second }, - kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapSever), + resources = resources.map { r -> r.second }, + kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer), zookeeperConfig = zookeeperConfig["server"].toString(), topics = kafkaConfig.topics) } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt index 54e91fb4b1c95b3bf95188a216418836fd374928..a0fed22533fef06c3c3bee7342d527a6a45c038a 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt @@ -16,7 +16,7 @@ class KubernetesBenchmarkDeployment( ): BenchmarkDeployment { private val workloadGeneratorStateCleaner = WorkloadGeneratorStateCleaner(this.zookeeperConfig) private val kafkaController = TopicManager(this.kafkaConfig) - private val kubernetesManager = K8sManager(DefaultKubernetesClient().inNamespace("theodolite-she")) // Maybe per resource type + private val kubernetesManager = K8sManager(DefaultKubernetesClient().inNamespace("theodolite-she")) override fun setup() { this.workloadGeneratorStateCleaner.deleteState() diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt index ce0295b3f5f36edc2217250318f64654535ac6df..ee7273c028020e9c9b6f42fa5eaec5c799d3f68b 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt @@ -4,7 +4,7 @@ import theodolite.benchmark.Benchmark import theodolite.util.* import java.time.Duration -class BenchmarkExecutorImpl(benchmark: Benchmark, results: Results, executionDuration: Duration, val configurationOverrides: List<ConfigurationOverride>) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides) { +class BenchmarkExecutorImpl(benchmark: Benchmark, results: Results, executionDuration: Duration, private val configurationOverrides: List<ConfigurationOverride>) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides) { override fun runExperiment(load: LoadDimension, res: Resource): Boolean { val benchmarkDeployment = benchmark.buildDeployment(load, res, this.configurationOverrides) benchmarkDeployment.setup() diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt index 21360e6c67ed658cc7f2e5e30e8b6e752bfbd587..f75927c0e947be7ecf6c273fac9633be79893a58 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt @@ -3,7 +3,6 @@ package theodolite.util import org.apache.kafka.clients.admin.NewTopic class KafkaConfig() { - lateinit var bootstrapSever: String + lateinit var bootstrapServer: String lateinit var topics: List<NewTopic> - } \ No newline at end of file diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt index 9804dab401d75b11a21a5738e74488eb471b16f1..2f6fcb22e5faf3bddfb5b9bbefbf3901caef2f48 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/LoadDimension.kt @@ -1,11 +1,11 @@ package theodolite.util data class LoadDimension(private val number: Int, private val type: String) { - public fun get(): Int { + fun get(): Int { return this.number; } - public fun getType(): String { + fun getType(): String { return this.type } } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt index fecb218b2744d6ea2b31d1bcb2599669b72fdacc..f315bb54d0c69f52dc794851fa3572b24385e370 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Resource.kt @@ -1,11 +1,11 @@ package theodolite.util data class Resource(private val number: Int, private val type: String) { - public fun get(): Int { + fun get(): Int { return this.number; } - public fun getType(): String { + fun getType(): String { return this.type } } \ No newline at end of file diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Results.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Results.kt index 11f0ba7cc0fe085810686ea1335635bb8e842614..cf3da20d206a06556e9ef6f6ce2488f8bf210a29 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Results.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Results.kt @@ -5,18 +5,17 @@ import theodolite.util.Resource import kotlin.math.exp class Results { - // load, instances - private val results: MutableMap<Pair<LoadDimension, Resource>, Boolean> = mutableMapOf() // multi map guava + private val results: MutableMap<Pair<LoadDimension, Resource>, Boolean> = mutableMapOf() - public fun setResult(experiment: Pair<LoadDimension, Resource>, successful: Boolean) { + fun setResult(experiment: Pair<LoadDimension, Resource>, successful: Boolean) { this.results[experiment] = successful } - public fun getResult (experiment: Pair<LoadDimension, Resource>): Boolean? { + fun getResult (experiment: Pair<LoadDimension, Resource>): Boolean? { return this.results[experiment] } - public fun getMinRequiredInstances(load: LoadDimension?, resourceTyp: String): Resource? { + fun getMinRequiredInstances(load: LoadDimension?, resourceTyp: String): Resource? { if (this.results.isEmpty()) return Resource(Int.MIN_VALUE, resourceTyp) var requiredInstances: Resource? = Resource(Int.MAX_VALUE, resourceTyp) @@ -32,7 +31,7 @@ class Results { return requiredInstances } - public fun getMaxBenchmarkedLoad(load: LoadDimension): LoadDimension? { + fun getMaxBenchmarkedLoad(load: LoadDimension): LoadDimension? { var maxBenchmarkedLoad: LoadDimension? = null; for(experiment in results) { if (experiment.value) {