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 {
* - `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"]
......
......@@ -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,
......
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