Skip to content
Snippets Groups Projects
Commit ec4d5bf1 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Resolve merge conflicts, update from lag trend percentages to ratio

parents f632d24b f8211093
No related branches found
No related tags found
1 merge request!180Make the analysis of experiments more flexible
This commit is part of merge request !180. Comments created here will be created in the context of that merge request.
......@@ -3,7 +3,7 @@
RELEASE_NAME=$1 # Supposed to be equal to tag, e.g., v0.3.0
RELEASE_PATH="https://github.com/cau-se/theodolite/releases/download"
REPO_INDEX="../../docs/index.yaml"
REPO_INDEX="../docs/index.yaml"
helm repo index . --url $RELEASE_PATH/$RELEASE_NAME --merge $REPO_INDEX && \
mv index.yaml $REPO_INDEX
\ No newline at end of file
......@@ -250,11 +250,6 @@ operator:
imageTag: latest
imagePullPolicy: Always
executionCRD:
create: true
benchmarkCRD:
create: true
sloChecker:
lagTrend:
enabled: true
......@@ -281,6 +276,9 @@ rbac:
randomScheduler:
enabled: true
image: ghcr.io/cau-se/theodolite-random-scheduler
imageTag: latest
imagePullPolicy: Always
rbac:
create: true
serviceAccount:
......
......@@ -7,6 +7,9 @@ repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://packages.confluent.io/maven/'
}
}
dependencies {
......
......@@ -118,7 +118,7 @@ spec:
minItems: 1
items:
type: object
required: ["name", "numPartitions", "replicationFactor"]
required: ["name"]
properties:
name:
description: The name of the topic.
......
......@@ -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,16 @@ class SloCheckerFactory {
threshold = properties["threshold"]?.toInt() ?: throw IllegalArgumentException("threshold expected"),
warmup = properties["warmup"]?.toInt() ?: throw IllegalArgumentException("warmup expected")
)
SloTypes.LAG_TREND_PERCENTAGE.value, SloTypes.DROPPED_RECORDS_PERCENTAGE.value -> {
if (!properties["loadType"].equals("NumSensors")) {
throw IllegalArgumentException("Percent Threshold is only allowed with load type NumSensors")
}
val 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)")
SloTypes.LAG_TREND_RATIO.value, SloTypes.DROPPED_RECORDS_RATIO.value -> {
val 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
val threshold = (load.get() * thresholdPercent).toInt()
val threshold = (load.get() * thresholdRatio).toInt()
ExternalSloChecker(
externalSlopeURL = properties["externalSloUrl"]
......
......@@ -8,8 +8,8 @@ class SloConfigHandler() {
companion object {
fun getQueryString(sloType: String): String {
return when (sloType.toLowerCase()) {
SloTypes.LAG_TREND.value, SloTypes.LAG_TREND_PERCENTAGE.value -> "sum by(group)(kafka_consumergroup_group_lag >= 0)"
SloTypes.DROPPED_RECORDS.value, SloTypes.DROPPED_RECORDS_PERCENTAGE.value -> "sum by(job) (kafka_streams_stream_task_metrics_dropped_records_total>=0)"
SloTypes.LAG_TREND.value, SloTypes.LAG_TREND_RATIO.value -> "sum by(group)(kafka_consumergroup_group_lag >= 0)"
SloTypes.DROPPED_RECORDS.value, SloTypes.DROPPED_RECORDS_RATIO.value -> "sum by(job) (kafka_streams_stream_task_metrics_dropped_records_total>=0)"
else -> throw InvalidPatcherConfigurationException("Could not find Prometheus query string for slo type $sloType")
}
}
......
......@@ -2,9 +2,9 @@ package theodolite.evaluation
enum class SloTypes(val value: String) {
LAG_TREND("lag trend"),
LAG_TREND_PERCENTAGE("lag trend percentage"),
LAG_TREND_RATIO("lag trend ratio"),
DROPPED_RECORDS("dropped records"),
DROPPED_RECORDS_PERCENTAGE("dropped records percentage")
DROPPED_RECORDS_RATIO("dropped records ratio")
}
\ No newline at end of file
......@@ -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,
......@@ -118,10 +115,10 @@ class TheodoliteExecutor(
val ioHandler = IOHandler()
val resultsFolder = ioHandler.getResultFolderURL()
this.config.executionId = getAndIncrementExecutionID(resultsFolder + "expID.txt")
ioHandler.writeToJSONFile(this.config, "$resultsFolder${this.config.executionId}-execution-configuration")
ioHandler.writeToJSONFile(this.config, "${resultsFolder}exp${this.config.executionId}-execution-configuration")
ioHandler.writeToJSONFile(
kubernetesBenchmark,
"$resultsFolder${this.config.executionId}-benchmark-configuration"
"${resultsFolder}exp${this.config.executionId}-benchmark-configuration"
)
val config = buildConfig()
......@@ -133,7 +130,7 @@ class TheodoliteExecutor(
}
ioHandler.writeToJSONFile(
config.compositeStrategy.benchmarkExecutor.results,
"$resultsFolder${this.config.executionId}-result"
"${resultsFolder}exp${this.config.executionId}-result"
)
}
......
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