diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt index 8c15fa1dc60d2d72a5b30508ea4570b8449f817b..fb343a0fa594c3f0d46125ca0debc7d0a6c223d8 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/Benchmark.kt @@ -8,6 +8,6 @@ interface Benchmark { fun buildDeployment( load: LoadDimension, res: Resource, - configurationOverrides: List<ConfigurationOverride> + configurationOverrides: List<ConfigurationOverride?> ): BenchmarkDeployment } diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt index 25535e1a64db9641cd47747cf8676b3994964690..5e640bf0e848ea3ad96280941f7f36427e20a613 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt @@ -10,7 +10,7 @@ class BenchmarkExecution { lateinit var resources: ResourceDefinition lateinit var slos: List<Slo> lateinit var execution: Execution - lateinit var configOverrides: List<ConfigurationOverride> + lateinit var configOverrides: List<ConfigurationOverride?> class Execution { lateinit var strategy: String diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index 0110e1d7cdbbe150fc6d76bc303770b989f5d739..4091325bdfd08fe74d115e8b86dc87e96f1eabda 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -40,7 +40,7 @@ class KubernetesBenchmark : Benchmark { override fun buildDeployment( load: LoadDimension, res: Resource, - configurationOverrides: List<ConfigurationOverride> + configurationOverrides: List<ConfigurationOverride?> ): BenchmarkDeployment { val resources = loadKubernetesResources(this.appResource + this.loadGenResource) val patcherFactory = PatcherFactory() @@ -50,7 +50,7 @@ class KubernetesBenchmark : Benchmark { res.getType().forEach{ patcherDefinition -> patcherFactory.createPatcher(patcherDefinition, resources).patch(res.get().toString()) } // 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( diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutor.kt index d3c2fdcbc0274066e62dd2dfe01fd2a8cf940f13..f18fc1cbbe989b41b8786630f6ee2dd8ffe174d3 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutor.kt @@ -23,7 +23,7 @@ abstract class BenchmarkExecutor( val benchmark: Benchmark, val results: Results, val executionDuration: Duration, - configurationOverrides: List<ConfigurationOverride>, + configurationOverrides: List<ConfigurationOverride?>, val slo: BenchmarkExecution.Slo ) { diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt index 25ec1bf5fcd49bd28269b29b1a70ab966b3ac65a..e8b7a1a26790aeaf8caf7903a5d98479d7d3e21e 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt @@ -16,7 +16,7 @@ class BenchmarkExecutorImpl( benchmark: Benchmark, results: Results, executionDuration: Duration, - private val configurationOverrides: List<ConfigurationOverride>, + private val configurationOverrides: List<ConfigurationOverride?>, slo: BenchmarkExecution.Slo ) : BenchmarkExecutor(benchmark, results, executionDuration, configurationOverrides, slo) { override fun runExperiment(load: LoadDimension, res: Resource): Boolean { diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt index d5f73338718af26c49ff86d63c16a4fa5a903646..490d37c3297908bc657fcfb96f98fe8a036a6ea7 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt @@ -22,11 +22,13 @@ object TheodoliteYamlExecutor { val benchmark = 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) executor.run() logger.info { "Theodolite finished" } + Runtime.getRuntime().removeShutdownHook(shutdown) exitProcess(0) } } diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/TestBenchmark.kt b/theodolite-quarkus/src/test/kotlin/theodolite/TestBenchmark.kt index 487b583188e8e5741900615108e2b2fa913353df..6f476278d08eacfc9857c1e5431636e5a219f26c 100644 --- a/theodolite-quarkus/src/test/kotlin/theodolite/TestBenchmark.kt +++ b/theodolite-quarkus/src/test/kotlin/theodolite/TestBenchmark.kt @@ -11,7 +11,7 @@ class TestBenchmark : Benchmark { override fun buildDeployment( load: LoadDimension, res: Resource, - configurationOverrides: List<ConfigurationOverride> + configurationOverrides: List<ConfigurationOverride?> ): BenchmarkDeployment { return TestBenchmarkDeployment() }