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

Minor style fixes

parent 6b2d51f8
No related branches found
No related tags found
3 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline #2829 passed
...@@ -39,12 +39,11 @@ class BenchmarkExecutorImpl( ...@@ -39,12 +39,11 @@ class BenchmarkExecutorImpl(
* Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user. * Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user.
*/ */
if (this.run.get()) { if (this.run.get()) {
result = result = AnalysisExecutor(slo = slo, executionId = executionId).analyze(
AnalysisExecutor(slo = slo, executionId = executionId).analyze( load = load,
load = load, res = res,
res = res, executionDuration = executionDuration
executionDuration = executionDuration )
)
this.results.setResult(Pair(load, res), result) this.results.setResult(Pair(load, res), result)
} }
...@@ -52,7 +51,7 @@ class BenchmarkExecutorImpl( ...@@ -52,7 +51,7 @@ class BenchmarkExecutorImpl(
benchmarkDeployment.teardown() benchmarkDeployment.teardown()
} catch (e: Exception) { } catch (e: Exception) {
logger.warn { "Error while tearing down the benchmark deployment." } 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 return result
......
...@@ -46,7 +46,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) { ...@@ -46,7 +46,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) {
val label = resource.spec.selector.matchLabels["app"]!! val label = resource.spec.selector.matchLabels["app"]!!
this.client.apps().deployments().delete(resource) this.client.apps().deployments().delete(resource)
blockUntilPodDeleted(label) blockUntilPodDeleted(label)
logger.info { "Deployment '$resource' deleted." } logger.info { "Deployment '${resource.metadata.name}' deleted." }
} }
is Service -> is Service ->
this.client.services().delete(resource) this.client.services().delete(resource)
...@@ -56,7 +56,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) { ...@@ -56,7 +56,7 @@ class K8sManager(private val client: NamespacedKubernetesClient) {
val label = resource.spec.selector.matchLabels["app"]!! val label = resource.spec.selector.matchLabels["app"]!!
this.client.apps().statefulSets().delete(resource) this.client.apps().statefulSets().delete(resource)
blockUntilPodDeleted(label) blockUntilPodDeleted(label)
logger.info { "StatefulSet '$resource' deleted." } logger.info { "StatefulSet '$resource.metadata.name' deleted." }
} }
is ServiceMonitorWrapper -> resource.delete(client) is ServiceMonitorWrapper -> resource.delete(client)
else -> throw IllegalArgumentException("Unknown Kubernetes resource.") else -> throw IllegalArgumentException("Unknown Kubernetes resource.")
......
...@@ -11,6 +11,7 @@ import theodolite.util.Results ...@@ -11,6 +11,7 @@ import theodolite.util.Results
* @param results [Result] object used as a basis to restrict the resources. * @param results [Result] object used as a basis to restrict the resources.
*/ */
class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) { class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) {
override fun apply(load: LoadDimension, resources: List<Resource>): List<Resource> { override fun apply(load: LoadDimension, resources: List<Resource>): List<Resource> {
val maxLoad: LoadDimension? = this.results.getMaxBenchmarkedLoad(load) val maxLoad: LoadDimension? = this.results.getMaxBenchmarkedLoad(load)
var lowerBound: Resource? = this.results.getMinRequiredInstances(maxLoad) var lowerBound: Resource? = this.results.getMinRequiredInstances(maxLoad)
...@@ -19,4 +20,5 @@ class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) { ...@@ -19,4 +20,5 @@ class LowerBoundRestriction(results: Results) : RestrictionStrategy(results) {
} }
return resources.filter { x -> x.get() >= lowerBound.get() } return resources.filter { x -> x.get() >= lowerBound.get() }
} }
} }
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