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

clean up

parent 98edf33f
No related branches found
No related tags found
1 merge request!180Make the analysis of experiments more flexible
......@@ -36,7 +36,6 @@ class AnalysisExecutor(
* @return true if the experiment succeeded.
*/
fun analyze(load: LoadDimension, res: Resource, executionIntervals: List<Pair<Instant, Instant>>): Boolean {
var result = false
var repetitionCounter = 1
......
......@@ -3,13 +3,16 @@ package theodolite.evaluation
import theodolite.util.InvalidPatcherConfigurationException
import javax.enterprise.context.ApplicationScoped
private const val CONSUMER_LAG_QUERY = "sum by(group)(kafka_consumergroup_group_lag >= 0)"
private const val DROPPED_RECORDS_QUERY = "sum by(job) (kafka_streams_stream_task_metrics_dropped_records_total>=0)"
@ApplicationScoped
class SloConfigHandler() {
companion object {
fun getQueryString(sloType: String): String {
return when (sloType.toLowerCase()) {
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)"
SloTypes.LAG_TREND.value, SloTypes.LAG_TREND_RATIO.value -> CONSUMER_LAG_QUERY
SloTypes.DROPPED_RECORDS.value, SloTypes.DROPPED_RECORDS_RATIO.value -> DROPPED_RECORDS_QUERY
else -> throw InvalidPatcherConfigurationException("Could not find Prometheus query string for slo type $sloType")
}
}
......
......@@ -53,7 +53,6 @@ class BenchmarkExecutorImpl(
* Analyse the experiment, if [run] is true, otherwise the experiment was canceled by the user.
*/
if (this.run.get()) {
val experimentResults = slos.map {
AnalysisExecutor(slo = it, executionId = executionId)
.analyze(
......@@ -65,7 +64,6 @@ class BenchmarkExecutorImpl(
result = (false !in experimentResults)
this.results.setResult(Pair(load, res), result)
}
return result
}
......
......@@ -64,7 +64,7 @@ data class PromResult(
/**
* Label of the metric
*/
var metric: Map<String,String>? = null,
var metric: Map<String, String>? = null,
/**
* Values of the metric (e.g. [ [ <unix_time>, "<sample_value>" ], ... ])
*/
......
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