Skip to content
Snippets Groups Projects
Commit 88bc461a authored by Simon Ehrenstein's avatar Simon Ehrenstein
Browse files

Integrate kubernetes resources an logging

parent f75dd66b
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
class Benchmark {
fun start() {}
fun stop() {}
fun startWorkloadGenerator(wg: String, dimValue: Int, ucId: String) { }
}
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() {}
}
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
......@@ -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()]
......
package theodolite
package theodolite.k8s
import org.apache.kafka.clients.admin.AdminClient
import org.apache.kafka.clients.admin.AdminClientConfig
......
......@@ -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
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
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