Skip to content
Snippets Groups Projects
Commit eb635ffd authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

merge master

parents 7fa761e9 0c6b103c
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!78Resolve "Implement Quarkus/Kotlin protype"
package theodolite.execution package theodolite.execution
import mu.KotlinLogging import mu.KotlinLogging
import theodolite.util.Benchmark import theodolite.util.AbstractBenchmark
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
import theodolite.util.Resource import theodolite.util.Resource
import theodolite.util.Results import theodolite.util.Results
...@@ -17,7 +17,7 @@ private val logger = KotlinLogging.logger {} ...@@ -17,7 +17,7 @@ private val logger = KotlinLogging.logger {}
* @property executionDuration * @property executionDuration
* @constructor Create empty Benchmark executor * @constructor Create empty Benchmark executor
*/ */
abstract class BenchmarkExecutor(val benchmark: Benchmark, val results: Results, val executionDuration: Duration) { abstract class BenchmarkExecutor(val benchmark: AbstractBenchmark, val results: Results, val executionDuration: Duration) {
/** /**
* Run a experiment for the given parametrization, evaluate the experiment and save the result. * Run a experiment for the given parametrization, evaluate the experiment and save the result.
* *
......
package theodolite.execution package theodolite.execution
import mu.KotlinLogging import theodolite.util.AbstractBenchmark
import theodolite.util.Benchmark
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
import theodolite.util.Resource import theodolite.util.Resource
import theodolite.util.Results import theodolite.util.Results
import java.time.Duration import java.time.Duration
class BenchmarkExecutorImpl(benchmark: Benchmark, results: Results, executionDuration: Duration) : BenchmarkExecutor(benchmark, results, executionDuration) { class BenchmarkExecutorImpl(benchmark: AbstractBenchmark, results: Results, executionDuration: Duration) : BenchmarkExecutor(benchmark, results, executionDuration) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
benchmark.start(load, res) benchmark.start(load, res)
this.waitAndLog() this.waitAndLog()
......
package theodolite.execution package theodolite.execution
import mu.KotlinLogging import theodolite.util.AbstractBenchmark
import theodolite.execution.BenchmarkExecutor
import theodolite.util.Benchmark
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
import theodolite.util.Resource import theodolite.util.Resource
import theodolite.util.Results import theodolite.util.Results
import java.time.Duration import java.time.Duration
class TestBenchmarkExecutorImpl(private val mockResults: Array<Array<Boolean>>, benchmark: Benchmark, results: Results): class TestBenchmarkExecutorImpl(private val mockResults: Array<Array<Boolean>>, benchmark: AbstractBenchmark, results: Results):
BenchmarkExecutor(benchmark, results, executionDuration = Duration.ofSeconds(1)) { BenchmarkExecutor(benchmark, results, executionDuration = Duration.ofSeconds(1)) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
......
...@@ -6,13 +6,13 @@ import io.fabric8.kubernetes.api.model.apps.Deployment ...@@ -6,13 +6,13 @@ import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.DefaultKubernetesClient import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.NamespacedKubernetesClient import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import mu.KotlinLogging import mu.KotlinLogging
import theodolite.util.Benchmark import theodolite.util.AbstractBenchmark
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
import theodolite.util.Resource import theodolite.util.Resource
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { class UC1Benchmark(config: AbstractBenchmarkConfig) : AbstractBenchmark(config) {
private val workloadGeneratorStateCleaner: WorkloadGeneratorStateCleaner private val workloadGeneratorStateCleaner: WorkloadGeneratorStateCleaner
private val topicManager: TopicManager private val topicManager: TopicManager
...@@ -94,21 +94,3 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -94,21 +94,3 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
this.deploymentManager.setWorkloadEnv(this.wgDeployment, "workload-generator", environmentVariables) this.deploymentManager.setWorkloadEnv(this.wgDeployment, "workload-generator", environmentVariables)
this.deploymentManager.deploy(this.wgDeployment) this.deploymentManager.deploy(this.wgDeployment)
} }
data class UC1BenchmarkConfig(
val clusterZookeeperConnectionString: String,
val clusterKafkaConnectionString: String,
val externalZookeeperConnectionString: String,
val externalKafkaConnectionString: String,
val schemaRegistryConnectionString: String,
val kafkaTopics: List<String>,
val kafkaReplication: Short,
val kafkaPartition: Int,
val ucDeploymentPath: String,
val ucServicePath: String,
val configMapPath: String,
val wgDeploymentPath: String,
val ucImageURL: String,
val wgImageURL: String
) {}
}
package theodolite.util
import theodolite.k8s.UC1Benchmark
abstract class AbstractBenchmark(val config: AbstractBenchmarkConfig): Benchmark {
override fun start(load: LoadDimension, resources: Resource) {
this.clearClusterEnvironment()
this.initializeClusterEnvironment()
this.startSUT(resources)
this.startWorkloadGenerator(load)
}
data class AbstractBenchmarkConfig(
val clusterZookeeperConnectionString: String,
val clusterKafkaConnectionString: String,
val externalZookeeperConnectionString: String,
val externalKafkaConnectionString: String,
val schemaRegistryConnectionString: String,
val kafkaTopics: List<String>,
val kafkaReplication: Short,
val kafkaPartition: Int,
val ucDeploymentPath: String,
val ucServicePath: String,
val configMapPath: String,
val wgDeploymentPath: String,
val ucImageURL: String,
val wgImageURL: String
) {}
}
package theodolite.util package theodolite.util
import theodolite.k8s.UC1Benchmark interface Benchmark {
abstract class Benchmark(val config: UC1Benchmark.UC1BenchmarkConfig) {
fun start(load: LoadDimension, resources: Resource) { fun start(load: LoadDimension, resources: Resource) {
this.clearClusterEnvironment()
this.initializeClusterEnvironment()
this.startSUT(resources)
this.startWorkloadGenerator(load)
} }
abstract fun initializeClusterEnvironment(); fun initializeClusterEnvironment();
abstract fun clearClusterEnvironment(); fun clearClusterEnvironment();
abstract fun startSUT(resources: Resource);
abstract fun startWorkloadGenerator(load: LoadDimension) fun startSUT(resources: Resource);
} fun startWorkloadGenerator(load: LoadDimension)
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ package theodolite.util ...@@ -2,7 +2,7 @@ package theodolite.util
import theodolite.k8s.UC1Benchmark import theodolite.k8s.UC1Benchmark
class TestBenchmark : Benchmark( class TestBenchmark : AbstractBenchmark(
UC1Benchmark.UC1BenchmarkConfig( UC1Benchmark.UC1BenchmarkConfig(
zookeeperConnectionString = "", zookeeperConnectionString = "",
kafkaIPConnectionString = "", kafkaIPConnectionString = "",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment