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

Merge branch 'ratioSLOChecker' into 'master'

Use lag trend ratio instead of percent

See merge request !184
parents 11fcf2b8 29cfc7dd
No related branches found
No related tags found
1 merge request!184Use lag trend ratio instead of percent
Pipeline #4898 passed
...@@ -22,13 +22,13 @@ class SloCheckerFactory { ...@@ -22,13 +22,13 @@ class SloCheckerFactory {
* - `warmup`: time from the beginning to skip in the analysis. * - `warmup`: time from the beginning to skip in the analysis.
* *
* *
* ### `lag trend percent` * ### `lag trend ratio`
* Creates an [ExternalSloChecker] with defined parameters. * 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: * The properties map needs the following fields:
* - `externalSlopeURL`: Url to the concrete SLO checker service. * - `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. * - `warmup`: time from the beginning to skip in the analysis.
* *
* @param sloType Type of the [SloChecker]. * @param sloType Type of the [SloChecker].
...@@ -50,18 +50,15 @@ class SloCheckerFactory { ...@@ -50,18 +50,15 @@ class SloCheckerFactory {
threshold = properties["threshold"]?.toInt() ?: throw IllegalArgumentException("threshold expected"), threshold = properties["threshold"]?.toInt() ?: throw IllegalArgumentException("threshold expected"),
warmup = properties["warmup"]?.toInt() ?: throw IllegalArgumentException("warmup expected") warmup = properties["warmup"]?.toInt() ?: throw IllegalArgumentException("warmup expected")
) )
"lag trend percent" -> { "lag trend ratio" -> {
if (!properties["loadType"].equals("NumSensors")) { var thresholdRatio =
throw IllegalArgumentException("Percent Threshold is only allowed with load type NumSensors") properties["ratio"]?.toDouble()
} ?: throw IllegalArgumentException("ratio for threshold expected")
var thresholdPercent = if (thresholdRatio < 0.0) {
properties["percent"]?.toDouble() throw IllegalArgumentException("Threshold ratio needs to be an Double greater or equal 0.0")
?: 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)")
} }
// cast to int, as rounding is not really necessary // cast to int, as rounding is not really necessary
var threshold = (load.get() * thresholdPercent).toInt() var threshold = (load.get() * thresholdRatio).toInt()
ExternalSloChecker( ExternalSloChecker(
externalSlopeURL = properties["externalSloUrl"] externalSlopeURL = properties["externalSloUrl"]
......
...@@ -55,9 +55,6 @@ class TheodoliteExecutor( ...@@ -55,9 +55,6 @@ class TheodoliteExecutor(
this.kubernetesBenchmark.loadTypes 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 = executor =
BenchmarkExecutorImpl( BenchmarkExecutorImpl(
benchmark = kubernetesBenchmark, benchmark = kubernetesBenchmark,
......
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