Skip to content
Snippets Groups Projects
Commit 0d53d57d authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch '187-fix-empty-list-bug' into 'theodolite-kotlin'

Fix small bugs

See merge request !107
parents f580e1ae 99968c4e
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!107Fix small bugs,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline #2463 passed
...@@ -8,6 +8,6 @@ interface Benchmark { ...@@ -8,6 +8,6 @@ interface Benchmark {
fun buildDeployment( fun buildDeployment(
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
configurationOverrides: List<ConfigurationOverride> configurationOverrides: List<ConfigurationOverride?>
): BenchmarkDeployment ): BenchmarkDeployment
} }
...@@ -10,7 +10,7 @@ class BenchmarkExecution { ...@@ -10,7 +10,7 @@ class BenchmarkExecution {
lateinit var resources: ResourceDefinition lateinit var resources: ResourceDefinition
lateinit var slos: List<Slo> lateinit var slos: List<Slo>
lateinit var execution: Execution lateinit var execution: Execution
lateinit var configOverrides: List<ConfigurationOverride> lateinit var configOverrides: List<ConfigurationOverride?>
class Execution { class Execution {
lateinit var strategy: String lateinit var strategy: String
......
...@@ -40,7 +40,7 @@ class KubernetesBenchmark : Benchmark { ...@@ -40,7 +40,7 @@ class KubernetesBenchmark : Benchmark {
override fun buildDeployment( override fun buildDeployment(
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
configurationOverrides: List<ConfigurationOverride> configurationOverrides: List<ConfigurationOverride?>
): BenchmarkDeployment { ): BenchmarkDeployment {
val resources = loadKubernetesResources(this.appResource + this.loadGenResource) val resources = loadKubernetesResources(this.appResource + this.loadGenResource)
val patcherFactory = PatcherFactory() val patcherFactory = PatcherFactory()
...@@ -50,7 +50,7 @@ class KubernetesBenchmark : Benchmark { ...@@ -50,7 +50,7 @@ class KubernetesBenchmark : Benchmark {
res.getType().forEach{ patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(res.get().toString()) } res.getType().forEach{ patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(res.get().toString()) }
// Patch the given overrides // Patch the given overrides
configurationOverrides.forEach { override -> patcherFactory.createPatcher(override.patcher, resources).patch(override.value) } configurationOverrides.forEach { override -> override?.let { patcherFactory.createPatcher(it.patcher, resources).patch(override.value) } }
return KubernetesBenchmarkDeployment( return KubernetesBenchmarkDeployment(
......
...@@ -23,7 +23,7 @@ abstract class BenchmarkExecutor( ...@@ -23,7 +23,7 @@ abstract class BenchmarkExecutor(
val benchmark: Benchmark, val benchmark: Benchmark,
val results: Results, val results: Results,
val executionDuration: Duration, val executionDuration: Duration,
configurationOverrides: List<ConfigurationOverride>, configurationOverrides: List<ConfigurationOverride?>,
val slo: BenchmarkExecution.Slo val slo: BenchmarkExecution.Slo
) { ) {
......
...@@ -16,7 +16,7 @@ class BenchmarkExecutorImpl( ...@@ -16,7 +16,7 @@ class BenchmarkExecutorImpl(
benchmark: Benchmark, benchmark: Benchmark,
results: Results, results: Results,
executionDuration: Duration, executionDuration: Duration,
private val configurationOverrides: List<ConfigurationOverride>, private val configurationOverrides: List<ConfigurationOverride?>,
slo: BenchmarkExecution.Slo slo: BenchmarkExecution.Slo
) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides, slo) { ) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides, slo) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
......
...@@ -22,11 +22,13 @@ object TheodoliteYamlExecutor { ...@@ -22,11 +22,13 @@ object TheodoliteYamlExecutor {
val benchmark = val benchmark =
parser.parse("./../../../resources/main/yaml/BenchmarkType.yaml", KubernetesBenchmark::class.java)!! parser.parse("./../../../resources/main/yaml/BenchmarkType.yaml", KubernetesBenchmark::class.java)!!
Runtime.getRuntime().addShutdownHook(Shutdown(benchmarkExecution, benchmark)) val shutdown = Shutdown(benchmarkExecution, benchmark)
Runtime.getRuntime().addShutdownHook(shutdown)
val executor = TheodoliteExecutor(benchmarkExecution, benchmark) val executor = TheodoliteExecutor(benchmarkExecution, benchmark)
executor.run() executor.run()
logger.info { "Theodolite finished" } logger.info { "Theodolite finished" }
Runtime.getRuntime().removeShutdownHook(shutdown)
exitProcess(0) exitProcess(0)
} }
} }
...@@ -11,7 +11,7 @@ class TestBenchmark : Benchmark { ...@@ -11,7 +11,7 @@ class TestBenchmark : Benchmark {
override fun buildDeployment( override fun buildDeployment(
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
configurationOverrides: List<ConfigurationOverride> configurationOverrides: List<ConfigurationOverride?>
): BenchmarkDeployment { ): BenchmarkDeployment {
return TestBenchmarkDeployment() return TestBenchmarkDeployment()
} }
......
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