From 7ccdaea75514d59f1af718691be5e4e5ba88204b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de> Date: Sat, 17 Apr 2021 17:12:56 +0200 Subject: [PATCH] Minor style fixes --- .../theodolite/execution/BenchmarkExecutorImpl.kt | 13 ++++++------- .../src/main/kotlin/theodolite/k8s/K8sManager.kt | 4 ++-- .../strategies/restriction/LowerBoundRestriction.kt | 2 ++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt index d088f8d46..cd85c143e 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/BenchmarkExecutorImpl.kt @@ -39,12 +39,11 @@ class BenchmarkExecutorImpl( * Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user. */ if (this.run.get()) { - result = - AnalysisExecutor(slo = slo, executionId = executionId).analyze( - load = load, - res = res, - executionDuration = executionDuration - ) + result = AnalysisExecutor(slo = slo, executionId = executionId).analyze( + load = load, + res = res, + executionDuration = executionDuration + ) this.results.setResult(Pair(load, res), result) } @@ -52,7 +51,7 @@ class BenchmarkExecutorImpl( benchmarkDeployment.teardown() } catch (e: Exception) { logger.warn { "Error while tearing down the benchmark deployment." } - logger.debug { "Teardown failed, caused by: $e " } + logger.debug { "Teardown failed, caused by: $e" } } return result diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sManager.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sManager.kt index 09806e7b0..88424f003 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sManager.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/K8sManager.kt @@ -46,7 +46,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) { val label = resource.spec.selector.matchLabels["app"]!! this.client.apps().deployments().delete(resource) blockUntilPodDeleted(label) - logger.info { "Deployment '$resource' deleted." } + logger.info { "Deployment '${resource.metadata.name}' deleted." } } is Service -> this.client.services().delete(resource) @@ -56,7 +56,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) { val label = resource.spec.selector.matchLabels["app"]!! this.client.apps().statefulSets().delete(resource) blockUntilPodDeleted(label) - logger.info { "StatefulSet '$resource' deleted." } + logger.info { "StatefulSet '$resource.metadata.name' deleted." } } is ServiceMonitorWrapper -> resource.delete(client) else -> throw IllegalArgumentException("Unknown Kubernetes resource.") diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/strategies/restriction/LowerBoundRestriction.kt b/theodolite-quarkus/src/main/kotlin/theodolite/strategies/restriction/LowerBoundRestriction.kt index ee806a128..13bfedfe0 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/strategies/restriction/LowerBoundRestriction.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/strategies/restriction/LowerBoundRestriction.kt @@ -11,6 +11,7 @@ import theodolite.util.Results * @param results [Result] object used as a basis to restrict the resources. */ class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) { + override fun apply(load: LoadDimension, resources: List<Resource>): List<Resource> { val maxLoad: LoadDimension? = this.results.getMaxBenchmarkedLoad(load) var lowerBound: Resource? = this.results.getMinRequiredInstances(maxLoad) @@ -19,4 +20,5 @@ class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) { } return resources.filter { x -> x.get() >= lowerBound.get() } } + } -- GitLab