diff --git a/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt b/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt index 76b158a580102e209b13e247864dd7481b557638..93e8e6180f5a99486e500af022869d896067d128 100644 --- a/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt +++ b/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt @@ -22,13 +22,13 @@ class SloCheckerFactory { * - `warmup`: time from the beginning to skip in the analysis. * * - * ### `lag trend percent` + * ### `lag trend ratio` * Creates an [ExternalSloChecker] with defined parameters. - * The required threshold is computed using a percentage and the load of the experiment. + * The required threshold is computed using a ratio and the load of the experiment. * * The properties map needs the following fields: * - `externalSlopeURL`: Url to the concrete SLO checker service. - * - `percent`: of the executed load that is accepted for the slope. + * - `ratio`: of the executed load that is accepted for the slope. * - `warmup`: time from the beginning to skip in the analysis. * * @param sloType Type of the [SloChecker]. @@ -50,18 +50,15 @@ class SloCheckerFactory { threshold = properties["threshold"]?.toInt() ?: throw IllegalArgumentException("threshold expected"), warmup = properties["warmup"]?.toInt() ?: throw IllegalArgumentException("warmup expected") ) - "lag trend percent" -> { - if (!properties["loadType"].equals("NumSensors")) { - throw IllegalArgumentException("Percent Threshold is only allowed with load type NumSensors") - } - var thresholdPercent = - properties["percent"]?.toDouble() - ?: throw IllegalArgumentException("percent for threshold expected") - if (thresholdPercent < 0.0 || thresholdPercent > 1.0) { - throw IllegalArgumentException("Threshold percent need to be an Double in the range between 0.0 and 1.0 (inclusive)") + "lag trend ratio" -> { + var thresholdRatio = + properties["ratio"]?.toDouble() + ?: throw IllegalArgumentException("ratio for threshold expected") + if (thresholdRatio < 0.0) { + throw IllegalArgumentException("Threshold ratio needs to be an Double greater or equal 0.0") } // cast to int, as rounding is not really necessary - var threshold = (load.get() * thresholdPercent).toInt() + var threshold = (load.get() * thresholdRatio).toInt() ExternalSloChecker( externalSlopeURL = properties["externalSloUrl"] diff --git a/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt b/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt index bc9371763c30e4cef913a368b64e9989e7f2286b..f5054dc2d8c3525562118b559ab8987215dc4ea1 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt @@ -55,9 +55,6 @@ class TheodoliteExecutor( this.kubernetesBenchmark.loadTypes ) - // Add load type to check if the percentage lag trend is applicable - config.slos.forEach { it.properties["loadType"] = config.load.loadType } - executor = BenchmarkExecutorImpl( benchmark = kubernetesBenchmark,