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

Clean up SloFactory code

parent 223150f3
No related branches found
No related tags found
No related merge requests found
Pipeline #10452 passed
......@@ -7,18 +7,15 @@ import rocks.theodolite.kubernetes.model.KubernetesBenchmark.Slo
class SloFactory {
fun createSlos(execution: BenchmarkExecution, benchmark: KubernetesBenchmark): List<Slo> {
var benchmarkSlos = benchmark.slos
var executionSlos = execution.slos
val resultSlos = benchmark.slos.toMutableList()
for(executionSlo in executionSlos) {
for(i in 0 until benchmarkSlos.size) {
if(executionSlo.name == benchmarkSlos[i].name && executionSlo.properties != null) {
for (executionProperty in executionSlo.properties!!) {
benchmarkSlos[i].properties[executionProperty.key] = executionProperty.value
for (executionSlo in execution.slos) {
for (resultSlo in resultSlos) {
if (executionSlo.name == resultSlo.name && executionSlo.properties != null) {
resultSlo.properties.putAll(executionSlo.properties!!)
}
}
}
}
return benchmarkSlos
return resultSlos
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment